TCS Interview Question

SQL question based on aggregate function and groupby