create indexes#176
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation requires changes to pass the tests. The critical issue is that indexes must be named exactly as their corresponding columns (e.g., Email, Name, CustomerID), not with prefixes like index_customers_email or index_products_name. The check runs confirm that indexes for Product.Name and Customers.Email are not being found. This happens because: 1. The test suite expects indexes named Email and Name (matching column names exactly), 2. Your current implementation uses index_customers_email and index_products_name which don't match. To fix this, update your CREATE INDEX statements to use column names directly: CREATE INDEX Email ON Customers(Email); CREATE INDEX Name ON Products(Name); Note: The third index on Orders.CustomerID also needs to be renamed from idx_orders_customer_id to CustomerID to comply with the requirement. Once you correct the index naming to match the column names exactly, the tests should pass. This is a critical requirement explicitly stated in the task checklist.
✨ 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; | ||
|
|
||
| create index index_products_name on Products (Name); | ||
| create index index_customers_email on Customers (Email); |
There was a problem hiding this comment.
Index name should be Email (matching the column name) instead of index_customers_email
| # Write your SQL code for the database creation here. Good luck! | ||
| USE ShopDB; | ||
|
|
||
| create index index_products_name on Products (Name); |
There was a problem hiding this comment.
Index name should be Name (matching the column name) instead of index_products_name
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The code is missing a critical index that causes test failures. Based on the usage scenario analysis, the Orders table receives at least 100 new orders per day, meaning customer lookups on this table are frequent operations. You need to add a third index: CREATE INDEX CustomerID ON Orders(CustomerID);. Your current task.sql only has 2 of the 3 expected indexes (Email and Name), but the test suite will verify all three indexes exist. Once you add this index, your solution should pass the requirements.
✨ 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
| CREATE INDEX Name ON Products(Name); | ||
| CREATE INDEX Email ON Customers(Email); No newline at end of file |
There was a problem hiding this comment.
Missing index on Orders.CustomerID. The usage scenario states 'at least 100 new orders per day', which means the Orders table is heavily accessed. When the application looks up orders by customer, indexing CustomerID will optimize these queries. Add: CREATE INDEX CustomerID ON Orders(CustomerID);
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. The task.sql file correctly implements all three required indexes with proper naming conventions: Name on Products for search functionality, Email on Customers for login operations, and CustomerID on Orders for frequent order lookups. The USE ShopDB; statement is properly included to target the correct database. All indexes align perfectly with the usage patterns described in the scenario. Great work on analyzing the requirements and implementing the appropriate indexing strategy!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.