IBM Interview Question

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