CJCoding With Joseph
15free / daySign inCreate account

Took Both CS101 and MATH110

Define one CTE named taken that lists every completed enrollment as student_id and the course code, then join taken twice to students: once for CS101 and once for MATH110. Return first_name and last_name of the students who completed both courses, sorted by last_name, then first_name.

Expected result:

+------------+-----------+
| first_name | last_name |
+------------+-----------+
| Elijah     | Costa     |
| Charlotte  | Dubois    |
| Grace      | Lee       |
| James      | Mensah    |
| Ava        | Patel     |
| Emily      | Zhang     |
+------------+-----------+
6 rows
Hints3 available
Topics:
CTEs
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.