https://leetcode.com/problems/list-the-products-ordered-in-a-period/description/
List the Products Ordered in a Period - LeetCode
Can you solve this real interview question? List the Products Ordered in a Period - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
1
2
3
4
5
6
7
8
|
# Write your MySQL query statement below
select p.product_name, sum(unit) unit
from Orders o
join Products p
on o.product_id = p.product_id
where year(o.order_date) = 2020 and month(o.order_date) = 2
group by o.product_id
having unit>=100
|
cs |
반응형
'SQL' 카테고리의 다른 글
leetcode 1280. Students and Examinations (0) | 2023.04.12 |
---|---|
leetcode 577. Employee Bonus (0) | 2023.04.12 |
leetcode 1789. Primary Department for Each Employee (0) | 2023.04.08 |
leetcode 1251. Average Selling Price (0) | 2023.04.07 |
leetcode 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.04.06 |
댓글