Pergunta de entrevista da empresa Lennar

A sql question and then a data frame manipulation question/.