Pergunta de entrevista da empresa Revature

How would you write an SQL query for x?