Pergunta de entrevista da empresa HSBC

write query to find result form 2 tables as per the given condition.