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
- Matrix
- java
- string
- 코딩테스트
- 구현
- implement
- Method
- dynamic programming
- 파이썬
- bit manipulation
- Counting
- Data Structure
- greedy
- Math
- 자바
- Binary Search
- array
- Binary Tree
- SQL
- 코테
- database
- two pointers
- Number Theory
- Class
- sorting
- Tree
- Stack
- simulation
- geometry
- hash table
Archives
- Today
- Total
코린이의 소소한 공부노트
[LeetCode/Easy] 596. Classes More Than 5 Students 본문
1. Input
1) Table: Courses (primary key: (student,class))
2. Output
1) 최소 5명 이상의 학생이 듣고 있는 모든 수업명을 담아 반환
- 출력 순서는 상관 없다.
3. Example
설명: Math가 6명, English/Biology/Computer가 각 1명이 수업을 듣고있으므로 조건을 만족하는 수업은 Math뿐이다.
4. Code
1) 첫 코드(2023/03/16)
select c.class
from (
select class, count(*) cnt
from Courses
group by class
) c
where cnt>=5;
'코딩테스트 풀이 > SQL' 카테고리의 다른 글
[LeetCode/Easy] 620. Not Boring Movies (0) | 2023.03.17 |
---|---|
[LeetCode/Easy] 607. Sales Person (0) | 2023.03.16 |
[LeetCode/Easy] 595. Big Countries (0) | 2023.03.16 |
[LeetCode/Easy] 584. Find Customer Referee (0) | 2023.03.16 |
[LeetCode/Easy] 183. Customers Who Never Order (0) | 2023.03.14 |