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
5 changes: 5 additions & 0 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1013,4 +1013,9 @@ insert into Orders (CustomerID, OrderDate, ProductID, Quantity) values (1000, '2

-- Write query to create the index that you will create to optimize a query like
-- SELECT * FROM Orders WHERE CustomerID = {abc} AND OrderDate > '{abc}';
-- we can't be able to search faster by using this reason behind it will sort the data based on customerId and their is no tie betweem customerId, orderDate we couldn't able to make use of orderDate.
--CREATE INDEX idx_CustomerID_OrderDate ON Orders (CustomerID, OrderDate);
-- Better approach we can apply index on customerId it would be much faster in that case.
CREATE INDEX idx_CustomerID_OrderDate ON Orders (CustomerID);