Walmart Interview Question

SQL group by and having case questions