Write a SQL query from a plain-English question and your schema, with an explanation of how it works, the edge cases it handles, and what would keep it fast at scale.