solution#190
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because your SQL script currently violates a core requirement of the task and blocks execution in a clean environment. The assignment explicitly requires that you drop and recreate the ShopDB database before using it, but your task.sql starts with USE ShopDB; and assumes the database already exists, which causes ERROR 1049 (42000): Unknown database 'ShopDB' when run on a fresh setup.
Critical issue to fix (blocker):
- At the very top of
task.sql(beforeUSE ShopDB;), add database lifecycle statements such as:DROP DATABASE IF EXISTS ShopDB;CREATE DATABASE ShopDB;- then keep
USE ShopDB;as you already have.
This directly addresses the requirement to recreateShopDBand ensures the script works both when the database is missing and when old schemas exist.
Aside from this, your normalization work is strong: you have clearly separated Countries, Products, Warehouses, and the ProductInventory junction table with quantities, and your INSERTs correctly reproduce the intended data in 3NF. Once you add the DROP DATABASE/CREATE DATABASE statements to satisfy the checklist and remove the execution blocker, your solution will fully meet the task 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
| -- Create database and tables | ||
|
|
||
| CREATE DATABASE ShopDB; | ||
| USE ShopDB; |
There was a problem hiding this comment.
Per the task description and checklist, you should drop and recreate the ShopDB database before using it (e.g., DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB;) so this script works in a clean environment and doesn’t rely on the database already existing.
No description provided.