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 |
Tags
- Data Structure
- 코테
- Binary Tree
- implement
- 파이썬
- Stack
- two pointers
- 구현
- 자바
- Matrix
- string
- Number Theory
- Class
- sorting
- Math
- SQL
- database
- 코딩테스트
- dynamic programming
- hash table
- java
- Tree
- greedy
- array
- Counting
- geometry
- simulation
- bit manipulation
- Binary Search
- Method
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 |