Skip to content

Normalize ShopDB to 3NF#165

Open
Xandane wants to merge 1 commit into
mate-academy:mainfrom
Xandane:main
Open

Normalize ShopDB to 3NF#165
Xandane wants to merge 1 commit into
mate-academy:mainfrom
Xandane:main

Conversation

@Xandane

@Xandane Xandane commented Apr 22, 2026

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

Your normalization approach is conceptually correct—splitting ProductInventory into Products, Warehouses, and a junction table is the right 3NF strategy. However, critical execution errors prevent the script from running. The main issues are: (1) Duplicate CREATE TABLE statements for Countries and ProductInventory will cause immediate "Table already exists" errors—remove the first definition of each table and keep only one. (2) INSERT statements reference non-existent columns—lines 53-60 still use old columns like ProductName, WarehouseName, WarehouseAmount that no longer exist in the new normalized structure. (3) Missing INSERTs for the new Products and Warehouses tables—you'll need separate INSERT statements for each. Fix the duplicate definitions first, then rewrite the INSERT statements to match the new table schemas with proper foreign key references.


✨ 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

Comment thread task.sql

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: NCM]

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@Losiev Losiev 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.

All tests should pass

@Losiev Losiev 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.

GitHub tests should pass

Run docker exec mysql sh -c 'mysql -u root -pP@ssw0rd < /scripts/task.sql'
Warning: arning] Using a password on the command line interface can be insecure.
ERROR 1050 (42S01) at line 24: Table 'Countries' already exists
Error: Process completed with exit code 1.

@Xandane

Xandane commented Apr 24, 2026

Copy link
Copy Markdown
Author

I don't quite understand why the tests aren't passing

@Xandane
Xandane requested a review from Losiev April 24, 2026 11:55

@linubah linubah 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.

Error in cheks is clear: Table 'Countries' already exists
you creating table two times in sql cript and the task is to update tables it to the third normal form

@Xandane
Xandane requested a review from linubah April 26, 2026 12:53
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.

4 participants