Citi interview question

Simple sql questions related to grouping