Complete the code to create a composite index on columns 'last_name' and 'first_name'.
CREATE INDEX idx_name ON employees([1], first_name);The composite index should start with 'last_name' followed by 'first_name' to optimize queries filtering by last name first.
Complete the code to select rows using the composite index on 'last_name' and 'first_name'.
SELECT * FROM employees WHERE last_name = 'Smith' AND [1] = 'John';
The composite index is on 'last_name' and 'first_name', so the query should filter on both columns to use the index efficiently.
Fix the error in the composite index creation by placing columns in the correct order.
CREATE INDEX idx_order ON orders([1], order_date);The composite index should start with 'customer_id' before 'order_date' to optimize queries filtering by customer first.
Fill both blanks to create a composite index on 'category' and 'price' columns.
CREATE INDEX idx_product ON products([1], [2]);
The composite index should be on 'category' first, then 'price' to optimize queries filtering by category and price range.
Fill all three blanks to create a composite index on 'region', 'sales_rep', and 'sale_date' columns.
CREATE INDEX idx_sales ON sales([1], [2], [3]);
The composite index should be created with 'region' first, then 'sales_rep', and finally 'sale_date' to optimize queries filtering by these columns in this order.