Solution.#188
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because one core requirement of the task is still missing and it directly affects whether the script can be run as specified. The instructions explicitly say that you must drop any existing ShopDB before recreating it using DROP DATABASE ShopDB; (optionally IF EXISTS), and this is tied to multiple checklist items ([CHECKLIST ITEM #3], [#10], [#11]). Without that statement at the top of task.sql, running the script on a server where ShopDB already exists will fail at CREATE DATABASE ShopDB;, which is considered a blocking issue for this exercise.
To fix this, add a line like DROP DATABASE IF EXISTS ShopDB; directly above your CREATE DATABASE ShopDB; statement in task.sql. Everything else in your normalization work looks solid: your tables are in third normal form, and your INSERT statements preserve the original logical data across countries, warehouses, products, and inventory. As a minor improvement (not required for passing), you could consider renaming WarehousesID to WarehouseID for clarity. Once you add the required DROP DATABASE statement, your solution should fully satisfy the task requirements and be ready to run with test.sql. ✅
✨ 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,5 +1,3 @@ | |||
| -- Create database and tables | |||
|
|
|||
| CREATE DATABASE ShopDB; | |||
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because it fully meets the functional and normalization requirements for the ShopDB task. Your schema correctly defines Countries, Products, Warehouses, and a normalized ProductInventory table with appropriate primary and foreign keys, achieving 3NF while preserving all information from the original denormalized structure. The script cleanly drops, recreates, and selects ShopDB, then creates the tables and repopulates the test data so that the original logical dataset is still representable via joins. The CI failure is due to the test environment expecting DROP DATABASE IF EXISTS ShopDB; instead of DROP DATABASE ShopDB;, which is an infrastructure/configuration issue rather than a problem with your code. As a small robustness improvement (not required), you could change the first line to DROP DATABASE IF EXISTS ShopDB; and optionally rename WarehousesID to WarehouseID for more conventional naming. Overall, this is a solid, requirement-compliant implementation of the normalized database schema.
✨ 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,5 +1,4 @@ | |||
| -- Create database and tables | |||
|
|
|||
| DROP DATABASE ShopDB; | |||
There was a problem hiding this comment.
The instructions recommend dropping any existing ShopDB before recreating it. Consider using DROP DATABASE IF EXISTS ShopDB; here so the script also succeeds on a fresh server where ShopDB might not exist yet, but this is a robustness improvement rather than a strict task requirement.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because your SQL script successfully normalizes the ShopDB schema into separate Countries, Products, Warehouses, and ProductInventory tables, achieving 3NF while preserving all original data via the updated INSERT statements. The primary and foreign keys are well thought out, and the recreated test data clearly matches the original logical dataset, which shows solid understanding of normalization.
There are a couple of small improvement opportunities: on the ProductInventory table, using WarehouseID instead of WarehousesID would better align with the Warehouses(ID) naming and typical conventions, and the instructions asked for DROP DATABASE ShopDB; while you used DROP DATABASE IF EXISTS ShopDB;—your version is more robust, but it does technically differ from the exact wording of the requirement. Because those are minor and more about style/spec wording than correctness, this is an educational override approval to help you keep progressing while learning. Overall, your work shows a strong grasp of normalization concepts and careful data preservation—well done, and keep applying this level of attention to future database designs.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.