Piramal Finance Interview Question

SQL querries based question on how to write query with SQL groupby