CGI Interview Question

write a for loop and a basic sql