-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: main
Are you sure you want to change the base?
solution #56
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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); | ||
|
||
-- Create an index for the Products table to optimize product searches by Name | ||
CREATE INDEX Name ON Products (Name); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive name for the index on the |
||
-- Create an index for the Orders table to optimize queries by CustomerID | ||
CREATE INDEX CustomerID ON Orders (CustomerID); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive name for the index on the |
||
-- 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive name for the index on the |
There was a problem hiding this comment.
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 asidx_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.