Pergunta de entrevista da empresa Servosys Solutions

sql join, and one logical tricky question