Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions unit1/question1_minju.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- sale_id에 해당하는 제품 이름, 판매 연도, 판매 가격 조회
SELECT s.sale_id, p.product_name, s.year, s.price
FROM sales s
INNER JOIN product p
ON s.product_id = p.product_id
9 changes: 9 additions & 0 deletions unit1/question2_minju.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- 2025년 2월에 100개 이상 주문한 제품명과 수량 조회
SELECT p.product_name, SUM(o.unit) AS unit
FROM products p
INNER JOIN orders o
ON p.product_id = o.product_id
WHERE YEAR(o.order_date) = 2025
AND MONTH(o.order_date) = 2
Comment on lines +6 to +7
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 날짜를 이렇게도 비교할 수 있군요! 잘 봤습니다

GROUP BY p.product_id, p.product_name
HAVING SUM(o.unit) >= 100
6 changes: 6 additions & 0 deletions unit1/question3_minju.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- 매니저보다 급여가 높은 직원 이름 조회
SELECT e.name
FROM employee e
INNER JOIN employee m
ON e.manager_id = m.emp_id
WHERE e.salary > m.salary