Passengers board a shuttle one at a time in turn order. The shuttle can carry at most 1000 kg in total, and boarding stops at the first person who would push the total over the limit, even if someone later in line is lighter. Turn numbers are unique, and person_id does not follow turn order. Write an SQL query that returns person_name of the last person who boards.
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.