Citi Interview Question

Simple sql questions related to grouping