Skip to content

Solution2#184

Open
volodymyrlp wants to merge 3 commits into
mate-academy:mainfrom
volodymyrlp:main
Open

Solution2#184
volodymyrlp wants to merge 3 commits into
mate-academy:mainfrom
volodymyrlp:main

Conversation

@volodymyrlp

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 database schema is well-normalized to 3NF with proper table decomposition, which is good work. However, there are two critical issues that block approval:

1. Missing DROP DATABASE statement (line 1): Requirement #2 explicitly specifies using DROP DATABASE ShopDB; before creating a new database. You've used CREATE DATABASE IF NOT EXISTS instead, which doesn't properly follow the requirements. Replace this with DROP DATABASE IF EXISTS ShopDB; followed by CREATE DATABASE ShopDB;.

2. Syntax error (line 48-49): There's a stray period in your SQL that causes the script to fail when executed. The error ERROR 1064 (42000) ... near '.' at line 1 indicates a malformed statement, likely from a trailing period after a semicolon (something like ;.;). Remove this extra period.

Once you fix both the DROP DATABASE statement and the syntax error, your solution will meet the requirements. The normalization work itself is solid—just needs these two corrections to be fully functional.


✨ 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
-- Create database and tables

CREATE DATABASE ShopDB;
CREATE DATABASE IF NOT EXISTS ShopDB;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requirement #2 specifies using DROP DATABASE ShopDB; statement to delete the existing database before creating a new one. Using CREATE DATABASE IF NOT EXISTS does not properly follow the requirements.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Syntax error: stray period after the semicolon will cause MySQL to fail parsing this statement. Remove the . at the end.

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

Please delete all unnecessary files from PR

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

Well done

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.

3 participants