Using the sales table, calculate how many distinct days each customer visited the restaurant.
Show the columns customer_id and visit_days, and order by customer_id.
Hints
-
Hint 1
The same customer can appear multiple times on the same day.
So you need to count distinct dates.
-
Hint 2
Use GROUP BY customer_id.
The final count column must be named visit_days.