Providence Interview Question

one simple sql query and a coding question