Skip to content

Commit 842f3bc

Browse files
committed
Solvesql Solution
- SQL
1 parent 80289d9 commit 842f3bc

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- @ss.idx: 5
2+
-- @ss.level: 3
3+
-- @ss.title: 작품이 없는 작가 찾기
4+
-- @ss.slug: artists-without-artworks
5+
-- @ss.category: JOIN/UNION
6+
-- @ss.note:
7+
8+
SELECT ar.artist_id
9+
, ar.name
10+
FROM artists ar
11+
WHERE ar.death_year IS NOT NULL
12+
AND NOT EXISTS (
13+
SELECT 1
14+
FROM artworks a
15+
JOIN artworks_artists aa ON a.artwork_id = aa.artwork_id
16+
WHERE aa.artist_id = ar.artist_id
17+
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- @ss.idx: 6
2+
-- @ss.level: 3
3+
-- @ss.title: 멘토링 짝꿍 리스트
4+
-- @ss.slug: mentor-mentee-list
5+
-- @ss.category: JOIN/UNION
6+
-- @ss.note:
7+
8+
SELECT
9+
e1.employee_id AS mentee_id,
10+
e1.name AS mentee_name,
11+
e2.employee_id AS mentor_id,
12+
e2.name AS mentor_name
13+
FROM employees e1
14+
LEFT JOIN employees e2 ON e2.department != e1.department
15+
AND e2.join_date <= DATE_SUB('2021-12-31', INTERVAL 2 YEAR)
16+
WHERE e1.join_date >= DATE_SUB('2021-12-31', INTERVAL 3 MONTH)
17+
ORDER BY mentee_id, mentor_id;

0 commit comments

Comments
 (0)