The report shows the orders of a customer found by name. There is one customer with a dozen orders — and both tables are read whole.
The join itself is not the problem — the problem is that there is no road to the customer's orders. Build it; an index on users.name is not needed in this task.
SELECT o.id, o.status, o.created_at FROM orders o JOIN users u ON u.id = o.user_id WHERE u.name = 'Anna 100'
You may only change the schema: indexes and ANALYZE. The query stays as the task wrote it — no need to send it back.
Grading runs on a larger dataset than the samples show — the answer has to hold at scale.
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in