Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 구현
- 코딩테스트
- Binary Tree
- array
- database
- Counting
- hash table
- Number Theory
- string
- Tree
- bit manipulation
- Math
- Method
- two pointers
- Matrix
- SQL
- Binary Search
- dynamic programming
- 파이썬
- Stack
- 자바
- Data Structure
- geometry
- implement
- java
- greedy
- sorting
- simulation
- 코테
- Class
Archives
- Today
- Total
코린이의 소소한 공부노트
[LeetCode/Easy] 1327. List the Products Ordered in a Period 본문
1. Input
1) Table: Products (pk: product_id)
2) Table: Orders (no pk)
2. Output
1) 상품들 중 2020년 2월에 최소 100개 이상 팔린 제품의 이름과 그 양을 출력
- 출력 순서는 상관 없다.
3. Example
4. Code
1) 첫 코드(2023/06/11)
select p.product_name, o.unit
from Products p, (
select product_id, sum(unit) as unit
from Orders
where order_date between '2020-02-01' and '2020-02-29'
group by product_id
) o
where p.product_id = o.product_id and unit>=100;
- 21%
'코딩테스트 풀이 > SQL' 카테고리의 다른 글
[LeetCode/Easy] 1141. User Activity for the Past 30 Days I (0) | 2023.06.08 |
---|---|
[LeetCode/Easy] 627. Swap Salary (0) | 2023.05.25 |
[LeetCode/Easy] 619. Biggest Single Number (0) | 2023.05.25 |
[LeetCode/Easy] 511. Game Play Analysis I (0) | 2023.05.23 |
[LeetCode/Easy] 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.05.02 |