CGI interview question

write a for loop and a basic sql