Pregunta de entrevista de IBM

They asked basic DSA question and One SQL query that I solved using Join.