Bkash interview question

SQL query, having, group by