SQL practice: Indexes and EXPLAIN
Chapter 31 · 6 questions · included in full access
Question 1 · easy
Solve it in your browserAdd an index on order_items.order_id.
Question 2 · easy
Solve it in your browserAdd an index on orders.customer_id.
Question 3 · medium
Solve it in your browserRun EXPLAIN on a query filtering order_items by order_id. Which scan does it use?
Question 4 · medium
Solve it in your browserWhich three columns in this database would you index first, and why?
Question 5 · hard
Solve it in your browserExplain why adding ten indexes to order_items would be a bad idea.
Question 6 · hard
Solve it in your browserWould an index help a query with no WHERE and no JOIN, like SELECT * FROM products? Why or why not?
These questions are part of full access.
The first chapters of every track are free. Full access is a one-time payment.
See pricing