Skip to content

Normalize ShopDB to 3NF: extract Products and Warehouses tables#157

Open
NazarKulyk6 wants to merge 2 commits intomate-academy:mainfrom
NazarKulyk6:main
Open

Normalize ShopDB to 3NF: extract Products and Warehouses tables#157
NazarKulyk6 wants to merge 2 commits intomate-academy:mainfrom
NazarKulyk6:main

Conversation

@NazarKulyk6
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

task.sql Outdated
-- Table 4: ProductInventory (normalized - only 4 columns: ID, ProductID, WarehouseAmount, WarehouseID)
CREATE TABLE ProductInventory (
ID INT NOT NULL,
ProductID INT,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants