Skip to content

Commit d90fe2f

Browse files
committed
Upload 141
1 parent 2187155 commit d90fe2f

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ The problems and both submitted and site solutions are documented in individual
173173
| 138 | [Patients With a Condition](https://leetcode.com/problems/patients-with-a-condition/description/) | [Solution](solutions/138_patients_with_a_condition.md) | LeetCode | Easy | |
174174
| 139 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/description/) | [Solution](solutions/139_second_highest_salary.md) | LeetCode | Medium | |
175175
| 140 | [Group Sold Products By The Date](https://leetcode.com/problems/group-sold-products-by-the-date/description/) | [Solution](solutions/140_group_sold_products_by_the_date.md) | DataLemur | Easy | `GROUP_CONCAT()` |
176+
| 141 | [List the Products Ordered in a Period](https://leetcode.com/problems/list-the-products-ordered-in-a-period/) | [Solution](solutions/141_list_the_products_ordered_in_a_period.md) | DataLemur | Easy | |
176177
<!-- Index End - WARNING: Do not delete or modify this markdown comment. -->
177178

178179
## Author(s)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SQL Everyday \#141
2+
3+
## List the Products Ordered in a Period
4+
5+
Site: DataLemur\
6+
Difficulty per Site: Easy
7+
8+
## Problem
9+
10+
Write a solution to get the names of products that have at least `100` units ordered in *February 2020* and their amount.
11+
12+
Return the result table in *any order*. [[Full Description](https://leetcode.com/problems/list-the-products-ordered-in-a-period/)]
13+
14+
## Submitted Solution
15+
16+
```sql
17+
-- Submitted Solution
18+
SELECT
19+
p.product_name
20+
,SUM(unit) AS unit
21+
FROM Products p
22+
JOIN Orders o ON p.product_id = o.product_id
23+
WHERE EXTRACT(YEAR FROM o.order_date) = '2020'
24+
AND EXTRACT(MONTH FROM o.order_date) = '02'
25+
GROUP BY product_name
26+
HAVING unit >= 100
27+
ORDER BY product_name ASC
28+
;
29+
```
30+
31+
## Site Solution
32+
33+
```sql
34+
-- DataLemur Solution
35+
-- None
36+
```
37+
38+
## Notes
39+
40+
TBD
41+
42+
## NB
43+
44+
TBD
45+
46+
Go to [Index](../?tab=readme-ov-file#index)\
47+
Go to [Overview](../?tab=readme-ov-file)

0 commit comments

Comments
 (0)