From 4eb7bd0237dfa6e0cc4ffb78cf110a5d5841433c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Chac=C3=B3n=20Guti=C3=A9rrez?= <138903866+joseantoniochacon@users.noreply.github.com> Date: Tue, 1 Oct 2024 12:12:17 -0600 Subject: [PATCH] Time: 633 ms (73.77%), Space: 0B (100.00%) - LeetHub --- .../1327-list-the-products-ordered-in-a-period.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 1327-list-the-products-ordered-in-a-period/1327-list-the-products-ordered-in-a-period.sql diff --git a/1327-list-the-products-ordered-in-a-period/1327-list-the-products-ordered-in-a-period.sql b/1327-list-the-products-ordered-in-a-period/1327-list-the-products-ordered-in-a-period.sql new file mode 100644 index 0000000..3bc9516 --- /dev/null +++ b/1327-list-the-products-ordered-in-a-period/1327-list-the-products-ordered-in-a-period.sql @@ -0,0 +1,3 @@ +# Write your MySQL query statement below + +SELECT Products.product_name, SUM(unit) AS unit FROM Orders JOIN Products ON Orders.product_id = Products.product_id WHERE MONTH(order_date) = 2 AND YEAR(order_date) = 2020 GROUP BY Products.product_name HAVING unit >= 100; \ No newline at end of file