CGI Interview Question

SQL joins, filtering and sorting on 2 columns