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

solution #56

wants to merge 1 commit into from

Conversation

zaebalsya1
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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);

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);

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);

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);

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);

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.

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