Buck interview question

Basic SQL some queries based on group by and joins