Skip to content

created new tables, separeted Inserting data#173

Open
Grom201 wants to merge 4 commits into
mate-academy:mainfrom
Grom201:develop
Open

created new tables, separeted Inserting data#173
Grom201 wants to merge 4 commits into
mate-academy:mainfrom
Grom201:develop

Conversation

@Grom201

@Grom201 Grom201 commented May 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 script fails to execute due to critical column mismatches between INSERT statements and table definitions. The ProductInventory table is defined with ProductName, WarehouseName, and WarehouseAddress, but your INSERT statements reference ProductID and WarehouseID columns that don't exist. Additionally, the table still contains redundant warehouse attributes (WarehouseName, WarehouseAddress, CountryID) instead of foreign keys to separate tables, which violates 3NF requirements. Finally, the required DROP DATABASE ShopDB; statement is missing from the script. These are blockers that prevent your code from running and fulfilling the normalization 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread task.sql
INSERT INTO Warehouses (ID, Name, Address, CountryID)
VALUES (2, 'Warehouse-2', 'City-2, Street-2', 2);

INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

INSERT references column 'ProductID' which doesn't exist in the ProductInventory table definition. The table only has ProductName, not ProductID. Either add ProductID column as FK or adjust to match the actual table structure.

Comment thread task.sql
INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID)
VALUES (1, 1, 2, 1);

INSERT INTO ProductInventory (ID, ProductID, WarehouseAmount, WarehouseID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

INSERT references column 'WarehouseID' which doesn't exist in the ProductInventory table definition. The table has WarehouseName and WarehouseAddress, not WarehouseID. Either add WarehouseID column as FK or adjust to match the actual table structure.

@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 database normalization is well-executed with proper 3NF structure and all INSERT statements correctly matching table definitions. However, the script is missing the required DROP DATABASE IF EXISTS ShopDB; statement that is explicitly mentioned in the task requirements (step 2 and "How to Test Yourself" step 1). Add this statement at the very beginning of the script, before the CREATE DATABASE ShopDB; line, to ensure the script can be run repeatedly without errors from an existing database. Once this single line is added, your solution will fully meet all 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

  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

Your implementation is excellent and fully meets all requirements. You successfully normalized the database to 3NF with a proper relational structure separating concerns into Countries, Products, Warehouses, and ProductInventory tables. The foreign key relationships are correctly defined, allowing multiple warehouses per product as required. Adding the DROP DATABASE IF EXISTS ShopDB; statement at line 2 shows good understanding of making scripts idempotent. All INSERT statements properly match the new normalized schema with appropriate foreign key references.


✨ 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