Skip to content

Commit 083affa

Browse files
committed
Solvesql Solution
- SQL
1 parent 5c04b1d commit 083affa

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- @ss.idx: 13
2+
-- @ss.level: 2
3+
-- @ss.title: 언더스코어(_)가 포함되지 않은 데이터 찾기
4+
-- @ss.slug: data-without-underscore
5+
-- @ss.category: String/Date
6+
-- @ss.note: 정규표현식 REGEXP 또는 INSTR 사용
7+
8+
SELECT DISTINCT page_location
9+
FROM ga
10+
WHERE 1 = 1
11+
AND page_location NOT LIKE '%\_%'
12+
-- AND page_location NOT REGEXP '_'
13+
-- INSTR(page_location, '_') = 0
14+
ORDER BY page_location;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- @ss.idx: 12
2+
-- @ss.level: 2
3+
-- @ss.title: 제목이 모음으로 끝나지 않는 영화
4+
-- @ss.slug: film-ending-with-consonant
5+
-- @ss.category: String/Date
6+
-- @ss.note: 정규표현식 REGEXP 또는 RIGHT 사용
7+
8+
SELECT title
9+
FROM film
10+
WHERE rating IN ('R', 'NC-17')
11+
AND title NOT REGEXP '[AEIOU]$';
12+
-- AND RIGHT(title, 1) NOT IN ('A','E','I','O','U');
13+
-- AND title NOT LIKE '%A'
14+
-- AND title NOT LIKE '%E'
15+
-- AND title NOT LIKE '%I'
16+
-- AND title NOT LIKE '%O'
17+
-- AND title NOT LIKE '%U';

Solvesql/Solutions/max-row.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- @ss.idx: 15
2+
-- @ss.level: 2
3+
-- @ss.title: 최대값을 가진 행 찾기
4+
-- @ss.slug: max-row
5+
-- @ss.category: Subquery/CTE
6+
-- @ss.note:
7+
8+
SELECT id
9+
FROM points
10+
WHERE x = (SELECT MAX(x) FROM points)
11+
UNION
12+
SELECT id
13+
FROM points
14+
WHERE y = (SELECT MAX(y) FROM points)
15+
ORDER BY id;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- @ss.idx: 14
2+
-- @ss.level: 2
3+
-- @ss.title: 게임을 10개 이상 발매한 게임 배급사 찾기
4+
-- @ss.slug: publisher-with-many-games
5+
-- @ss.category: Aggregate
6+
-- @ss.note:
7+
8+
SELECT c.name
9+
FROM games g
10+
JOIN companies c ON g.publisher_id = c.company_id
11+
GROUP BY c.company_id
12+
HAVING COUNT(c.company_id) >= 10;

0 commit comments

Comments
 (0)