← Back to Subqueries
Question 114
Students With Five or More Enrollments
Students With Five or More Enrollments
Find the students with five or more enrollments of any status. Returnfirst_name,last_nameandenrollments(the count), sorted bylast_name. Build the counts in a derived table (aSELECTinsideFROM, aliasedt) and join it tostudents.
Expected result:
+------------+-----------+-------------+ | first_name | last_name | enrollments | +------------+-----------+-------------+ | Charlotte | Dubois | 5 | | Grace | Lee | 5 | | Liam | Nguyen | 5 | | Emily | Zhang | 5 | +------------+-----------+-------------+ 4 rows
Hints3 available
Sign in to use hintsTopics:
Subqueries
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 on the left.