Domanda di colloquio di 1plusX

How would you create an SQL query for this...