Solution2#184
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your database schema is well-normalized to 3NF with proper table decomposition, which is good work. However, there are two critical issues that block approval:
1. Missing DROP DATABASE statement (line 1): Requirement #2 explicitly specifies using DROP DATABASE ShopDB; before creating a new database. You've used CREATE DATABASE IF NOT EXISTS instead, which doesn't properly follow the requirements. Replace this with DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB;.
2. Syntax error (line 48-49): There's a stray period in your SQL that causes the script to fail when executed. The error ERROR 1064 (42000) ... near '.' at line 1 indicates a malformed statement, likely from a trailing period after a semicolon (something like ;.;). Remove this extra period.
Once you fix both the DROP DATABASE statement and the syntax error, your solution will meet the requirements. The normalization work itself is solid—just needs these two corrections to be fully functional.
✨ 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 database and tables | ||
|
|
||
| CREATE DATABASE ShopDB; | ||
| CREATE DATABASE IF NOT EXISTS ShopDB; |
There was a problem hiding this comment.
Requirement #2 specifies using DROP DATABASE ShopDB; statement to delete the existing database before creating a new one. Using CREATE DATABASE IF NOT EXISTS does not properly follow the requirements.
| INSERT INTO ProductInventory (ID, ProductID, WarehouseID, WarehouseAmount) | ||
| VALUES (1, 1, 1, 2); | ||
| INSERT INTO ProductInventory (ID, ProductID, WarehouseID, WarehouseAmount) | ||
| VALUES (2, 1, 2, 5);. |
There was a problem hiding this comment.
Syntax error: stray period after the semicolon will cause MySQL to fail parsing this statement. Remove the . at the end.
Losiev
left a comment
There was a problem hiding this comment.
Please delete all unnecessary files from PR
No description provided.