Pergunta de entrevista da empresa RTB House

I was asked to read some php code and some sql.