Pregunta de entrevista de X by 2

How would you implement sql?