Skip to content

Solution#179

Open
KravAvfv wants to merge 6 commits into
mate-academy:mainfrom
KravAvfv:develop
Open

Solution#179
KravAvfv wants to merge 6 commits into
mate-academy:mainfrom
KravAvfv:develop

Conversation

@KravAvfv

@KravAvfv KravAvfv commented Jun 3, 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

Your implementation has a critical naming violation: all indexes use idx_* prefixes (e.g., idx_products_name, idx_customers_email) when the requirement explicitly states 'Indexes must be named the same as the columns for which you are creating the indexes.' You need to rename every index to match its column name exactly—Name, Email, CustomerID, Date, OrderID, ProductID. Additionally, the functional tests are failing because the required indexes for Product.Name and Customers.Email are reportedly missing, which means the core requirement of creating these indexes is not met. Please fix the index names and ensure all required indexes exist in your task.sql file.


✨ 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_products_name on Products (Name);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named Name (the column name), not idx_products_name. Per requirements: 'Indexes must be named the same as the columns for which they are created.'

Comment thread task.sql Outdated
USE ShopDB;

create index idx_products_name on Products (Name);
create index idx_products_price on Products (Price);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named Price, not idx_products_price. Also, Price may not need an index based on usage scenarios.

Comment thread task.sql Outdated

create index idx_products_name on Products (Name);
create index idx_products_price on Products (Price);
create index idx_products_amount on Products (WarehouseAmount);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named WarehouseAmount, not idx_products_amount. Also, WarehouseAmount is updated once a year (rarely queried), so may not need an index.

Comment thread task.sql Outdated
create index idx_products_price on Products (Price);
create index idx_products_amount on Products (WarehouseAmount);

create index idx_customers_FirstName on Customers (FirstName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named FirstName, not idx_customers_FirstName. Also, FirstName is not referenced in any usage scenario.

Comment thread task.sql Outdated
create index idx_products_amount on Products (WarehouseAmount);

create index idx_customers_FirstName on Customers (FirstName);
create index idx_customers_LastName on Customers (LastName);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named LastName, not idx_customers_LastName. Also, LastName is not referenced in any usage scenario.

Comment thread task.sql Outdated

create index idx_customers_FirstName on Customers (FirstName);
create index idx_customers_LastName on Customers (LastName);
create index idx_customers_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.

Naming violation: Index should be named Email, not idx_customers_email. This is a required index for customer login.

Comment thread task.sql Outdated
create index idx_customers_LastName on Customers (LastName);
create index idx_customers_email on Customers (Email);

create index idx_orders_customerID on Orders (CustomerID);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named CustomerID, not idx_orders_customerID. This index is needed for order lookups by customer.

Comment thread task.sql Outdated
create index idx_customers_email on Customers (Email);

create index idx_orders_customerID on Orders (CustomerID);
create index idx_orders_date on Orders (Date);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named Date, not idx_orders_date. Note: Date is a reserved keyword in MySQL and may require backticks (Date).

Comment thread task.sql Outdated
create index idx_orders_customerID on Orders (CustomerID);
create index idx_orders_date on Orders (Date);

create index idx_orderItems_orderID on OrderItems (OrderID);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Naming violation: Index should be named OrderID, not idx_orderItems_orderID.

Comment thread task.sql Outdated
create index idx_orders_date on Orders (Date);

create index idx_orderItems_orderID on OrderItems (OrderID);
create index idx_orderItems_productID on OrderItems (ProductID); 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.

Naming violation: Index should be named ProductID, not idx_orderItems_productID.

@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

The automated test is failing because your task.sql creates more indexes than required. While all six required indexes are correctly implemented with proper names, you've also added three additional indexes (Price, FirstName, LastName) that weren't specified in the task requirements. The test expects exactly the required indexes, so extra indexes cause it to fail.

To fix this, remove the three unnecessary indexes from your task.sql file:

  • Remove the index on Products.Price
  • Remove the index on Customers.FirstName
  • Remove the index on Customers.LastName

Your solution should only contain the six indexes that directly support the usage scenarios: Customers.Email, Products.Name, Orders.CustomerID, Orders.Date, OrderItems.OrderID, and OrderItems.ProductID. Once you remove the extra indexes, the test 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

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

@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

This is an educational approval to help you progress while learning. You've done excellent work removing the three unnecessary indexes (Price, FirstName, LastName) and correctly implementing 5 of the 6 required indexes. There's one missing piece: the Orders.Date index, which is needed for efficient daily order processing (100+ orders per day scenario). Add CREATE INDEX Date ON Orders (Date); to complete your solution. This is a common scenario in database optimization—indexing date columns is essential when you need to query or aggregate data by time periods. Once added, you'll have all six indexes matching the usage scenarios!


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

Footnotes

  1. Rate AI review example

Comment thread task.sql
Comment on lines 1 to +15
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;

-- Для Products: пошук товарів за назвою
CREATE INDEX Name ON Products (Name);

-- Для Customers: пошук клієнта за email при логіні
CREATE INDEX Email ON Customers (Email);

-- Для Orders: швидке з'єднання замовлень з клієнтами
CREATE INDEX CustomerID ON Orders (CustomerID);

-- Для OrderItems: прискорення операцій при додаванні товарів до замовлення
CREATE INDEX OrderID ON OrderItems (OrderID);
CREATE INDEX ProductID ON OrderItems (ProductID); 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.

Missing required index. The task requires an index on Orders.Date for daily order processing (100+ orders per day). Add: CREATE INDEX Date ON Orders (Date);

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