Skip to content

feat(task.sql): implement data normalization#162

Open
oleksandra-shershen wants to merge 3 commits into
mate-academy:mainfrom
oleksandra-shershen:develop
Open

feat(task.sql): implement data normalization#162
oleksandra-shershen wants to merge 3 commits into
mate-academy:mainfrom
oleksandra-shershen:develop

Conversation

@oleksandra-shershen
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

Your solution is approved because the SQL script correctly normalizes the ShopDB schema to 3NF, creates the necessary tables (Countries, Products, Warehouses, Inventory) with appropriate primary and foreign keys, and repopulates them with data equivalent to the original sample set. The database lifecycle is handled properly with DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB;, so the script can be safely rerun and still produce the expected state.

There are no critical or blocking issues that would prevent the task from being considered complete, but there are a few areas you could improve for robustness:

  • Make primary key columns explicitly NOT NULL and consider using AUTO_INCREMENT for integer IDs in tables like Countries, Products, and Warehouses.
  • Decide on and specify ON DELETE / ON UPDATE actions for foreign keys in Inventory to reflect the intended business rules (for example, ON DELETE CASCADE or ON DELETE RESTRICT).
  • Consider marking essential non-key columns such as ProductName, WarehouseName, and WarehouseAddress as NOT NULL, and optionally set ENGINE=InnoDB and DEFAULT CHARSET=utf8mb4 on your tables.
  • You may also want to fix minor cosmetic issues such as the AwersomeProduct typo and think about adding indexes on frequently queried columns for performance.
    Overall, this is solid work that meets the task requirements, and these suggestions are about strengthening data integrity and maintainability going forward.

✨ 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