After signing up, users can request confirmation messages, each of which ends as 'confirmed' or 'timeout'. A user's confirmation rate is the number of confirmed messages divided by the number of messages they requested. Users who never requested a message have a rate of 0. Every signed-up user must appear. Write an SQL query that returns user_id and confirmation_rate rounded to 2 decimal places. Order the results by user_id ascending.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.