Solution#204
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because there is still a critical technical violation that blocks meeting the task requirements. Your Price column in Products is defined as FLOAT, but the assignment explicitly restricts column types to INT, DATE, VARCHAR(50), or VARCHAR(100) [CHECKLIST ITEM #8]; this must be changed to one of the allowed types (for example, INT if you store prices in cents, or VARCHAR(50) if you just need a string representation). In addition, the execution logs show ERROR 1046 (3D000): No database selected, which means your script either does not select a database with USE ShopDB; or does not create it before creating tables; you need to ensure CREATE DATABASE ShopDB; (or CREATE DATABASE IF NOT EXISTS ShopDB;) appears before table creation and that you run USE ShopDB; right after.
To fix the critical issues:
- Update the
Pricecolumn definition inProducts(e.g.,Price INT NOT NULLorPrice VARCHAR(50) NOT NULL) so it uses a permitted type. - Make sure the script begins with creating and then selecting the
ShopDBdatabase before anyCREATE TABLEstatements.
The rest of your schema (tables, primary keys with AUTO_INCREMENT, and foreign keys with ON DELETE SET NULL) looks well-structured and aligned with the requirements, so once you address these points your solution should be in good shape.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
| CREATE TABLE Products ( | ||
| ID INT AUTO_INCREMENT, | ||
| Name VARCHAR(50), | ||
| Description VARCHAR(100), |
There was a problem hiding this comment.
Price uses the FLOAT type, which violates checklist item #8 that restricts column types to INT, DATE, VARCHAR(50), or VARCHAR(100). Update this column to one of the permitted types.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because your task.sql fully meets the assignment’s functional and technical requirements. You correctly create the ShopDB database and select it before defining any tables, and all four required tables (Products, Customers, Orders, OrderItems) are present with the specified columns and names. All column types are restricted to the allowed set (INT, DATE, VARCHAR(50), VARCHAR(100)), and primary keys are implemented as INT AUTO_INCREMENT as required. The three necessary relationships are correctly defined using FOREIGN KEY ... ON DELETE SET NULL between Orders–Customers, OrderItems–Orders, and OrderItems–Products, so deletions will behave as the task describes. You also fixed the Price column to use INT, aligning with the constraints on data types. There are no critical or blocking issues remaining, and the script should execute successfully on a MySQL instance as specified. Nicely done getting everything in line with the checklist and previous review feedback.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.