Subex interview question

SQL basics, Programs to write.