Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
16 changes: 14 additions & 2 deletions task.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Write your SQL code for the database creation here. Good luck!
USE ShopDB;
USE ShopDB;

-- Create an index for the Customers table to optimize login by Email
CREATE INDEX Email ON Customers (Email);

Choose a reason for hiding this comment

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

Consider using a more descriptive name for the index on the Email column, such as idx_Customers_Email, to make it clear which table and column the index is associated with. This can improve maintainability and readability of the database schema.

-- Create an index for the Products table to optimize product searches by Name
CREATE INDEX Name ON Products (Name);

Choose a reason for hiding this comment

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

Consider using a more descriptive name for the index on the Name column, such as idx_Products_Name, to make it clear which table and column the index is associated with.

-- Create an index for the Orders table to optimize queries by CustomerID
CREATE INDEX CustomerID ON Orders (CustomerID);

Choose a reason for hiding this comment

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

Consider using a more descriptive name for the index on the CustomerID column, such as idx_Orders_CustomerID, to make it clear which table and column the index is associated with.

-- Create indexes for the OrderItems table to optimize queries by OrderID and ProductID
CREATE INDEX OrderID ON OrderItems (OrderID);
CREATE INDEX ProductID ON OrderItems (ProductID);

Choose a reason for hiding this comment

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

Consider using a more descriptive name for the index on the OrderID column, such as idx_OrderItems_OrderID, to make it clear which table and column the index is associated with.

Loading