Skip to content

Commit 2817bc8

Browse files
authored
Create 1511-customer-order-frequency.sql
1 parent df6d556 commit 2817bc8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

1511-customer-order-frequency.sql

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Write your MySQL query statement below
2+
SELECT customer_id, name
3+
FROM Customers JOIN Orders USING(customer_id)
4+
JOIN Product USING(product_id)
5+
GROUP BY customer_id
6+
HAVING SUM(IF(LEFT(order_date, 7) = '2020-06', quantity, 0) * price) >= 100
7+
AND SUM(IF(LEFT(order_date, 7) = '2020-07', quantity, 0) * price) >= 100;

0 commit comments

Comments
 (0)