PwC interview question

sql language, domande di logica