TD Interview Question

they ask about some SQL queries