From the course: MySQL Data Analysis

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Challenge: COUNT and CASE

Challenge: COUNT and CASE - MySQL Tutorial

From the course: MySQL Data Analysis

Challenge: COUNT and CASE

- [Narrator] All right, time to test your skills with an assignment on the case pivot method using case and count. For this assignment, your business partner, Uncle Jimmy, is trying to figure out how many customers are inactive and active at each store. He'd like you to create a table which has the count of customers in it, and he wants it broken down by store ID, which should be the rows, and their active status, which should be the columns. Here's a preview of what your results should look like. Your job is to write the query using the case pivoting method that will produce these results. Keep in mind, this was a pro tip. It's a little more advanced, don't get frustrated. It's great if you can get this, but this may be one of the harder ones that you've had so far. Good luck.

Contents