Choose the right index for a query

SQL Medium 2 views
Back to Questions

Problem Description

Query: SELECT * FROM Orders WHERE customer_id=? AND order_date BETWEEN ? AND ?. Suggest an index and write it.

Input Format

SQL DDL

Output Format

DDL statement(s)

Sample Test Case

Input:
Orders(customer_id, order_date)
Output:
Index created

Constraints

Composite index for filter columns

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next