STMicroelectronics interview question

Some queries to write specifically group by ?