created new tables, separeted Inserting data#173
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your script fails to execute due to critical column mismatches between INSERT statements and table definitions. The ProductInventory table is defined with ProductName, WarehouseName, and WarehouseAddress, but your INSERT statements reference ProductID and WarehouseID columns that don't exist. Additionally, the table still contains redundant warehouse attributes (WarehouseName, WarehouseAddress, CountryID) instead of foreign keys to separate tables, which violates 3NF requirements. Finally, the required DROP DATABASE ShopDB; statement is missing from the script. These are blockers that prevent your code from running and fulfilling the normalization requirements.
✨ 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
| INSERT INTO Warehouses (ID, Name, Address, CountryID) | ||
| VALUES (2, 'Warehouse-2', 'City-2, Street-2', 2); | ||
|
|
||
| INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID) |
There was a problem hiding this comment.
INSERT references column 'ProductID' which doesn't exist in the ProductInventory table definition. The table only has ProductName, not ProductID. Either add ProductID column as FK or adjust to match the actual table structure.
| INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID) | ||
| VALUES (1, 1, 2, 1); | ||
|
|
||
| INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID) |
There was a problem hiding this comment.
INSERT references column 'WarehouseID' which doesn't exist in the ProductInventory table definition. The table has WarehouseName and WarehouseAddress, not WarehouseID. Either add WarehouseID column as FK or adjust to match the actual table structure.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your database normalization is well-executed with proper 3NF structure and all INSERT statements correctly matching table definitions. However, the script is missing the required DROP DATABASE IF EXISTS ShopDB; statement that is explicitly mentioned in the task requirements (step 2 and "How to Test Yourself" step 1). Add this statement at the very beginning of the script, before the CREATE DATABASE ShopDB; line, to ensure the script can be run repeatedly without errors from an existing database. Once this single line is added, your solution will fully meet all requirements.
✨ 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
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is excellent and fully meets all requirements. You successfully normalized the database to 3NF with a proper relational structure separating concerns into Countries, Products, Warehouses, and ProductInventory tables. The foreign key relationships are correctly defined, allowing multiple warehouses per product as required. Adding the DROP DATABASE IF EXISTS ShopDB; statement at line 2 shows good understanding of making scripts idempotent. All INSERT statements properly match the new normalized schema with appropriate foreign key references.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.