IBM interview question

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