Greensky Interview Question

SQL queries based on aggregation and Case statements