Skip to content

task.sql script for set-up database#164

Open
AndS9 wants to merge 3 commits intomate-academy:mainfrom
AndS9:develop
Open

task.sql script for set-up database#164
AndS9 wants to merge 3 commits intomate-academy:mainfrom
AndS9:develop

Conversation

@AndS9
Copy link
Copy Markdown

@AndS9 AndS9 commented Mar 28, 2026

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

Good job structuring the database schema with the correct tables and columns. However, I'm requesting changes because the script contains several critical syntax errors that prevent it from executing, which caused the build to fail.

Specifically, please address these issues:

  1. Missing Commas: Remember to separate all column and constraint definitions within a CREATE TABLE statement with a comma (,).
  2. Missing Semicolons: Each CREATE TABLE statement must end with a semicolon (;).
  3. Incorrect Foreign Key: In the OrderItems table, the foreign key that links to the Products table is incorrect. It should reference the ProductID column within the OrderItems table, not the table name Products.

Fixing these syntax issues should get your script working correctly. You're on the right track!


✨ 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

Price INT,
WarehouseAmount INT,
PRIMARY KEY (ID)
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This CREATE TABLE statement has some syntax errors that are repeated in the other tables. Remember to separate all column and constraint definitions with commas, and to end the entire statement with a semicolon (;).

task.sql Outdated
ProductID INT,
PRIMARY KEY (ID),
FOREIGN KEY (OrderID) REFERENCES Orders(ID) ON DELETE SET NULL,
FOREIGN KEY (ProductID) REFERENCES Products(ID) ON DELETE SET NULL
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The FOREIGN KEY must refer to a column in the current table (OrderItems). To link to the Products table, you should specify the ProductID column here, not the table name Products.

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.

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.

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

Great work on this SQL script! It's well-structured, functional, and meets all the core requirements, so I am approving your solution. One minor suggestion for the future is to match the casing for identifiers exactly as specified in the requirements (e.g., Name instead of NAME). While this doesn't affect functionality here, it's a good practice for consistency and portability. Overall, excellent job!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

*/
CREATE TABLE Products (
ID INT AUTO_INCREMENT,
NAME VARCHAR(100),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The requirement specifies this column should be named Name. While SQL is often case-insensitive for identifiers, it's best practice to match the naming in the requirements exactly to ensure portability and consistency.

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