Wag! interview question

SQL challenge