Pregunta de entrevista de OneAssist Consumer Solutions

SQL queries , one puzzle question