365 Days of Daily Coding: Day 64
Today, I woke up extremely late which I am not quite happy about but I did manage to complete some work that I intended to do today. I also have been reading information on a cryptocurrency and especially Cardano. I am excited to see how the team unfolds their vision.
I solved a medium SQL challenge in SQL pad which was relatively easier.
SELECT customer_group, COUNT(*)
FROM(
SELECT CASE
WHEN sums >=150 THEN 'high'
WHEN sums < 100 THEN 'low'
ELSE 'medium'
END AS customer_group
FROM(
SELECT customer_id, SUM(amount) AS sums
FROM payment
GROUP BY customer_id) AS k) AS l
GROUP BY customer_group;

Leave a comment