Skip to content

Solution 1#193

Open
Alexey211220 wants to merge 2 commits into
mate-academy:mainfrom
Alexey211220:develop
Open

Solution 1#193
Alexey211220 wants to merge 2 commits into
mate-academy:mainfrom
Alexey211220:develop

Conversation

@Alexey211220

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

I am requesting changes because a core task requirement about index naming is not yet met, and this blocks full completion of the assignment. The instructions state that “Indexes should be named the same as the columns for which you create the indexes”, but in task.sql you currently have CREATE INDEX idx_cust_email ON Customers (Email); and CREATE INDEX idx_prod_name ON Products (Name);, which do not match their column names. To fix this, rename the indexes so the index name is exactly the same as the column name, for example:

CREATE INDEX Email ON Customers (Email);
CREATE INDEX Name ON Products (Name);

This directly addresses the requirement tied to [CHECKLIST ITEM #13] and [CHECKLIST ITEM #17]. Aside from the naming issue, your choice of columns to index (login by email, search by product name) is appropriate and shows good understanding of the usage scenarios. Once you adjust the index names in task.sql, your solution should satisfy the core requirements and be in good shape.


✨ 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 Outdated
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;

CREATE INDEX idx_cust_email ON Customers (Email);

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 task requires that "Indexes should be named the same as the columns for which you create the indexes"; here the index name idx_cust_email does not match the column name Email, so you should rename the index to Email to comply.

Comment thread task.sql Outdated

CREATE INDEX idx_cust_email ON Customers (Email);

CREATE INDEX idx_prod_name ON Products (Name); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Similarly, this index is named idx_prod_name, but the requirement is that the index name must be identical to the column name Name; consider renaming the index to Name.

@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 solution is approved because task.sql meets the core functional and naming requirements of the assignment. You correctly switch to the existing database with USE ShopDB; and then create indexes on Customers.Email and Products.Name, which match the described usage scenarios (login lookups and product name searches). The index names are exactly the same as their respective columns, satisfying the explicit key‑naming requirement from the task. There are no syntax issues in the script, and assuming create-database.sql has already been run to create ShopDB, your file will execute cleanly on a MySQL server.

For future optimization (not required here), you could consider indexes on order‑related columns like Orders.CustomerID or OrderItems.OrderID if queries frequently filter or join on those fields. You might also add a brief comment at the top of task.sql indicating it should be run after create-database.sql to make the intended workflow clearer for anyone reading the script. Overall, you’ve implemented the required features correctly and aligned your indexes with the real usage scenarios, which is exactly what this task was aiming to teach.


✨ 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