Done#191
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because some core requirements of the task are not yet met and tests are failing as a result. You correctly switched to USE ShopDB; and created indexes on Customers.Email and Orders.CustomerID, but the index names do not follow the explicit rule that the index name must exactly match the column name (e.g., the index on Email must be named Email, and the one on CustomerID must be named CustomerID). In addition, the usage scenario clearly requires an index on Products.Name for frequent name-based product searches, and this index is currently missing, causing the “Index for Product.Name was not found” test failure. You also haven’t added any indexes for OrderItems, even though frequent order creation and lookups typically require indexes on relationship columns like OrderItems.OrderID and OrderItems.ProductID; you should decide which of these are used in joins/lookups and index them, naming each index exactly like its column.
To fix this, update task.sql to: 1) rename your existing indexes so each CREATE INDEX uses the column name as the index name; 2) add an index on Products(Name) named Name; and 3) add appropriate indexes on OrderItems (for example, on OrderID and/or ProductID), again using the column names as the index names. After making these changes, ensure task.sql runs cleanly against a fresh ShopDB created from create-database.sql and passes all checks in test.sql. You’re close—once you align the index coverage and naming with the requirements, this solution should pass.
✨ 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
| USE ShopDB; | ||
| USE ShopDB; | ||
|
|
||
| CREATE INDEX index_emails ON Customers (Email); |
There was a problem hiding this comment.
According to the task, index names must match their column names exactly. For this index on Email, rename it so the index name is Email, not index_emails. Also consider whether other columns (e.g., Products.Name) need indexes based on the usage scenarios and add them here.
| USE ShopDB; | ||
|
|
||
| CREATE INDEX index_emails ON Customers (Email); | ||
| CREATE INDEX index_customer_id ON Orders (CustomerID); No newline at end of file |
There was a problem hiding this comment.
Same naming issue here: the index on CustomerID should be named CustomerID rather than index_customer_id. Additionally, you currently don’t define any indexes for Products or OrderItems, which may be required based on the described query patterns (search by product name, frequent order and order item access).
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am approving your solution because your task.sql fully meets the functional and checklist requirements. You correctly switch to the ShopDB database with USE ShopDB;, and all required indexes are created on the appropriate columns: Customers(Email), Orders(CustomerID), Products(Name), and OrderItems(OrderID) plus OrderItems(ProductID). Each index is named exactly the same as its corresponding column (for example, index Email on Customers(Email)), which aligns with the explicit naming requirement. The script is valid SQL and should run cleanly against a fresh ShopDB created by the provided create-database.sql, with no missing functionality or broken behavior for the described usage scenarios. Overall, your indexing choices match the login, product search, and order lookup patterns described in the task, so this implementation is accepted as complete and correct.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.