Pergunta de entrevista da empresa Select Medical

How would you get records that exist on both tables with given conditions.