Magnaquest interview question

SQL & PLSQL