Skip to content

Normalize ShopDB database to 3NF#200

Open
Somewellich wants to merge 2 commits into
mate-academy:mainfrom
Somewellich:develop
Open

Normalize ShopDB database to 3NF#200
Somewellich wants to merge 2 commits into
mate-academy:mainfrom
Somewellich:develop

Conversation

@Somewellich

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because one core requirement is not yet satisfied: the script does not drop the existing ShopDB database before recreating it. The task explicitly calls for using DROP DATABASE ShopDB; (often written safely as DROP DATABASE IF EXISTS ShopDB;) before CREATE DATABASE ShopDB;, so omitting this is a critical blocker for repeatable runs and automated testing [CHECKLIST ITEM #8]. To fix this, add a line like DROP DATABASE IF EXISTS ShopDB; at the very top of task.sql, before any CREATE DATABASE ShopDB; statement. Aside from that, your normalization work is strong: you correctly separated Products, Warehouses, Countries, and the linking ProductInventory table, achieving 3NF and preserving the original sample data relationships. As a minor, non-blocking improvement, you could clean up small typos in the test data (e.g., product name spelling) and optionally add MySQL-specific options like ENGINE=InnoDB and DEFAULT CHARSET=utf8mb4 for clarity. Once you add the DROP DATABASE step, your solution will meet the functional requirements fully and be ready for testing.


✨ 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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution because your updated task.sql meets all core functional and technical requirements for the normalization task. You correctly drop and recreate ShopDB using DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB; and USE ShopDB;, making the script repeatable and aligned with the checklist [CHECKLIST ITEM #8]. The schema is properly normalized into separate Countries, Products, Warehouses, and ProductInventory tables, with appropriate foreign keys and no remaining transitive dependencies, which satisfies the 1NF→3NF requirement. Your INSERT statements were successfully adapted to the new structure while preserving the original test data semantics (same countries, warehouses, product, and inventory quantities), so existing tests and usage should behave as expected.

There are no critical or blocking issues that would prevent task completion or break functionality. As a minor best-practice improvement (not required for this task), you could consider explicitly specifying ENGINE=InnoDB and DEFAULT CHARSET=utf8mb4 on your CREATE TABLE statements in future MySQL work. Overall, this is a solid, clean solution that demonstrates a good understanding of normalization and relational design—well done.


✨ 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