Pregunta de entrevista de darwinLabs

How I would a SQL for a specific scenario