Everpure Interview Question

Easy SQL query question, for loop question...