Bkash Interview Question

SQL query, having, group by