CGI interview question

My SQL queries