Skip to content

Commit 93f1e8b

Browse files
refactor 596
1 parent be09e8c commit 93f1e8b

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

database/_596.sql

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,3 @@
1-
--596. Classes More Than 5 Students
2-
--SQL Schema
3-
--There is a table courses with columns: student and class
4-
--
5-
--Please list out all classes which have more than or equal to 5 students.
6-
--
7-
--For example, the table:
8-
--
9-
--+---------+------------+
10-
--| student | class |
11-
--+---------+------------+
12-
--| A | Math |
13-
--| B | English |
14-
--| C | Math |
15-
--| D | Biology |
16-
--| E | Math |
17-
--| F | Computer |
18-
--| G | Math |
19-
--| H | Math |
20-
--| I | Math |
21-
--+---------+------------+
22-
--Should output:
23-
--
24-
--+---------+
25-
--| class |
26-
--+---------+
27-
--| Math |
28-
--+---------+
29-
--
30-
--
31-
--Note:
32-
--The students should not be counted duplicate in each course.
33-
341
select class from courses
352
group by class
363
having count(distinct student) >= 5;

0 commit comments

Comments
 (0)