Normalize ShopDB to 3NF: extract Products and Warehouses tables#157
Normalize ShopDB to 3NF: extract Products and Warehouses tables#157NazarKulyk6 wants to merge 2 commits intomate-academy:mainfrom
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Great job on normalizing the database schema! The new table structure is well-designed. However, a couple of changes are needed. Your script is missing the required DROP DATABASE IF EXISTS ShopDB; statement at the beginning, which will cause an error if the script is run more than once. Additionally, to improve data integrity, the ProductID and WarehouseID columns in the ProductInventory table should be defined as NOT NULL, since an inventory record must be associated with a product and a warehouse.
✨ 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
task.sql
Outdated
| -- Table 4: ProductInventory (normalized - only 4 columns: ID, ProductID, WarehouseAmount, WarehouseID) | ||
| CREATE TABLE ProductInventory ( | ||
| ID INT NOT NULL, | ||
| ProductID INT, |
There was a problem hiding this comment.
Good job creating the ProductInventory table. However, consider making ProductID NOT NULL. An inventory record wouldn't make sense if it wasn't associated with a specific product. This change will improve the data integrity of your table.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this iteration! You've successfully addressed all the feedback from the previous review. The database schema is now correctly normalized to the third normal form, and the INSERT statements have been updated perfectly to match the new structure. Your script is clean, correct, and meets all task requirements, so I am approving your solution.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.