-
Notifications
You must be signed in to change notification settings - Fork 59
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
Conversation
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.
Great job on creating the necessary indexes to optimize the queries in the ShopDB
database! 🎉 While the functionality is spot on, consider adopting more descriptive naming conventions for your indexes in the future. This can enhance the maintainability and readability of your database schema. Keep up the excellent work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
USE ShopDB; | ||
|
||
-- Create an index for the Customers table to optimize login by Email | ||
CREATE INDEX Email ON Customers (Email); |
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 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 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 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 INDEX Name ON Products (Name); | ||
|
||
-- 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 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 INDEX CustomerID ON Orders (CustomerID); | ||
|
||
-- Create indexes for the OrderItems table to optimize queries by OrderID and ProductID | ||
CREATE INDEX OrderID ON OrderItems (OrderID); |
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 OrderID
column, such as idx_OrderItems_OrderID
, 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); |
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 ProductID
column, such as idx_OrderItems_ProductID
, to make it clear which table and column the index is associated with.
No description provided.