TCS interview question

SQL question based on aggregate function and groupby