Distinct Students Enrolled
easyQuestion 9The enrollments table has 90 rows, but many students appear in it several times. Return one row with enrollments (COUNT(*), every row) and students_enrolled (how many different student_id values appear, so a student taking four courses counts once). Three students have no enrollments, so the second number is below 30.
Expected result
+-------------+-------------------+ | enrollments | students_enrolled | +-------------+-------------------+ | 90 | 27 | +-------------+-------------------+ 1 row
Hints3 available
Sign in to use hintsTopics
Aggregates & GROUP BY
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)
Results
Run your SQL to see every statement's output here, then how it compares with the expected answer.
Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns, or open the database browser under the question.