← Back to INSERT, UPDATE & DELETE
Question 80
Three Enrollments in One Statement
Three Enrollments in One Statement
Aiden Rahman (28), Zoe Campbell (29) and Leo Martin (30) are the three students with no enrollments, and ART140 (course 13) is the course nobody has signed up for. Fix both with a singleINSERTthat adds three rows toenrollments: for each,student_idas given,course_id13,enrolled_on'2026-01-20' andpaid1. Leave every other column out sostatusdefaults to 'enrolled' andgrade,letter,attendance_pctandnotesstay NULL; the new rows get ids 91, 92 and 93.
Expected result:
enrollments after your statements: 93 rows +----+------------+-----------+-------------+-------+--------+-----------+----------------+------+---------------------+ | id | student_id | course_id | enrolled_on | grade | letter | status | attendance_pct | paid | notes | +----+------------+-----------+-------------+-------+--------+-----------+----------------+------+---------------------+ | 1 | 5 | 9 | 2024-09-03 | 78 | B | completed | 92.5 | 1 | NULL | | 2 | 5 | 7 | 2024-09-03 | 81 | B | completed | 88 | 1 | NULL | | 3 | 10 | 11 | 2024-09-04 | 74 | B | completed | 79 | 1 | NULL | | 4 | 10 | 7 | 2024-09-04 | 69 | C | completed | 71.5 | 1 | Late essay accepted | | 5 | 15 | 5 | 2024-09-05 | 97 | A | completed | 98 | 1 | NULL | +----+------------+-----------+-------------+-------+--------+-----------+----------------+------+---------------------+ (showing 5 of 93 rows)
Hints3 available
Sign in to use hintsTopics:
INSERT, UPDATE & DELETE
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.