Pregunta de entrevista de Yes Madam

Query based on joins