Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions task.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;
USE ShopDB;

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.

The index on Customers(Email) is appropriate and correctly named, but the requirements imply you should also consider other frequently-used or join columns (e.g., CustomerID in Orders, OrderID and ProductID in OrderItems).

CREATE INDEX 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.

Similarly, the index on Products(Name) is valid, but the task expects a broader analysis of the schema; consider adding indexes for relationship/lookup columns in Orders and OrderItems as well.

CREATE INDEX CustomerID ON Orders(CustomerID);
CREATE INDEX OrderID ON OrderItems(OrderID);
CREATE INDEX ProductID ON OrderItems(ProductID);
Loading