Skip to content

1#187

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

1#187
ll221 wants to merge 3 commits into
mate-academy:mainfrom
ll221:main

Conversation

@ll221

@ll221 ll221 commented Jun 16, 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

I am requesting changes because a core requirement of the task—indexing all frequently used relational columns based on the usage scenarios—is not fully met yet, which affects [CHECKLIST ITEM #2] and [CHECKLIST ITEM #9]. You correctly created indexes on Customers(Email) and Products(Name) in task.sql, with names matching the column names, which aligns with the login and product search scenarios. However, there are no indexes on Orders(CustomerID) or on OrderItems(OrderID) / OrderItems(ProductID), even though these foreign keys will be heavily used for joins and lookups in an online shop that processes at least 100 new orders per day.

The critical fixes needed are:

  • In task.sql, add indexes on Orders(CustomerID) and OrderItems(OrderID) with index names matching the column names, for example: CREATE INDEX CustomerID ON Orders(CustomerID); and CREATE INDEX OrderID ON OrderItems(OrderID);.
  • Strongly consider (and in this task, effectively are expected to) add CREATE INDEX ProductID ON OrderItems(ProductID); because product-based lookups in order items will also be frequent.
  • Optionally, update the initial comment in task.sql to reflect that this file is for index creation, not database creation; this is not a blocker, but will reduce confusion.

Once you add these missing indexes in task.sql, your solution will align with the checklist and the intended performance characteristics of the system. You’re very close—your existing index choices are good, you just need to complete the coverage for the orders-related tables.


✨ 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
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;
-- Логін: пошук клієнта по email
CREATE INDEX 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.

You’ve added good indexes for Customers(Email) and Products(Name), but the task also expects you to analyze and index other frequently used columns like CustomerID in Orders and OrderID/ProductID in OrderItems based on the usage scenarios (checklist items #2 and #9).

Comment thread task.sql Outdated
CREATE INDEX Email ON Customers(Email);

-- Пошук товару по назві
CREATE INDEX 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.

Consider also creating indexes on Orders(CustomerID) and OrderItems(OrderID) (and possibly OrderItems(ProductID)), with index names matching the column names, to fully satisfy the “analyze usage scenarios and index needed columns” requirement.

@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 approving your solution because it fully meets the functional and technical requirements of the task. Your task.sql correctly switches to ShopDB and creates all necessary indexes to support the described scenarios: login (Customers(Email)), product search (Products(Name)), and order-related lookups (Orders(CustomerID), OrderItems(OrderID), and OrderItems(ProductID)). All index names match their corresponding column names exactly, which satisfies the explicit naming constraint. The SQL syntax is valid for MySQL and should run cleanly as long as ShopDB and its tables are created beforehand by create-database.sql. There are no critical or blocking issues that would prevent the script from working as intended. Nicely done aligning the indexes with the real-world query patterns described in the task.


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

3 participants