CJCoding With Joseph
15free / daySign inCreate account

A New Instructor Takes Over BUS320

Business (department 5) hires Nadia Farouk to teach Financial Accounting. First INSERT her into instructors with first_name 'Nadia', last_name 'Farouk', email 'nadia.farouk@school.example', department_id 5, hire_date '2026-01-05', salary 84000 and title 'Assistant Professor'; leave id out (she becomes 13) and leave office, phone and is_tenured out so the first two are NULL and the third takes its DEFAULT of 0. Then UPDATE course 12 (BUS320, the only course with a NULL instructor_id) so its instructor_id is her new id. Only row 13 of instructors and row 12 of courses are new or changed.

Expected result:

instructors after your statements: 13 rows
+----+------------+-----------+--------------------------------+---------------+------------+--------+--------+--------------+------------+---------------------+
| id | first_name | last_name | email                          | department_id | hire_date  | salary | office | phone        | is_tenured | title               |
+----+------------+-----------+--------------------------------+---------------+------------+--------+--------+--------------+------------+---------------------+
|  1 | Grace      | Okafor    | grace.okafor@school.example    |             1 | 2012-08-20 |  98500 | T-210  | 416-555-0201 |          1 | Professor           |
|  2 | Daniel     | Reyes     | daniel.reyes@school.example    |             1 | 2019-01-14 |  82000 | T-214  | 416-555-0202 |          0 | Assistant Professor |
|  3 | Mei        | Chen      | mei.chen@school.example        |             1 | 2016-09-01 |  88000 | T-218  | NULL         |          1 | Associate Professor |
|  4 | Samuel     | Whitaker  | samuel.whitaker@school.example |             2 | 2009-07-06 | 101000 | G-105  | 416-555-0204 |          1 | Professor           |
|  5 | Priya      | Natarajan | priya.natarajan@school.example |             2 | 2021-08-30 |  76500 | G-112  | 416-555-0205 |          0 | Lecturer            |
+----+------------+-----------+--------------------------------+---------------+------------+--------+--------+--------------+------------+---------------------+
(showing 5 of 13 rows)

courses after your statements: 14 rows
+----+---------+-----------------------------+---------------+---------------+---------+-------+-----------+-------+-------------+-----+
| id | code    | title                       | department_id | instructor_id | credits | level | max_seats | room  | semester    | fee |
+----+---------+-----------------------------+---------------+---------------+---------+-------+-----------+-------+-------------+-----+
|  1 | CS101   | Introduction to Programming |             1 |             1 |       3 |   100 |        60 | T-100 | Fall 2025   | 650 |
|  2 | CS201   | Data Structures             |             1 |             2 |       3 |   200 |        40 | T-102 | Winter 2026 | 650 |
|  3 | CS230   | Databases                   |             1 |             3 |       3 |   200 |        35 | T-104 | Winter 2026 | 700 |
|  4 | CS310   | Operating Systems           |             1 |             1 |       4 |   300 |        30 | T-106 | Fall 2025   | 820 |
|  5 | MATH110 | Calculus I                  |             2 |             4 |       4 |   100 |        80 | G-001 | Fall 2025   | 600 |
+----+---------+-----------------------------+---------------+---------------+---------+-------+-----------+-------+-------------+-----+
(showing 5 of 14 rows)
Hints4 available
Topics:
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.