Walmart interview question

SQL group by and having case questions