CJCoding With Joseph
15free / daySign inCreate account

Curve the Computer Science GPAs

Add 0.1 to the gpa of every Computer Science major (major_department_id 1), rounding the result to two decimals with ROUND. Seven rows change: ids 1, 2, 12, 16, 19, 25 and 30 (3.80 becomes 3.9, 3.45 becomes 3.55, and so on). Lucas Fernandes (id 8), a CS major with no gpa yet, must still have NULL afterwards; whether you exclude him in the WHERE or rely on NULL + 0.1 being NULL is up to you. Nobody outside Computer Science changes.

Expected result:

students after your statements: 30 rows
+----+------------+-----------+--------------------------------+---------------------+-----------------+------+-------------+------------+-----------+--------------------+
| id | first_name | last_name | email                          | major_department_id | enrollment_year |  gpa | city        | birth_date | status    | scholarship_amount |
+----+------------+-----------+--------------------------------+---------------------+-----------------+------+-------------+------------+-----------+--------------------+
|  1 | Ava        | Patel     | ava.patel@student.example      |                   1 |            2023 |  3.9 | Toronto     | 2005-03-14 | active    |               2500 |
|  2 | Liam       | Nguyen    | liam.nguyen@student.example    |                   1 |            2022 | 3.55 | Mississauga | 2004-11-02 | active    |               NULL |
|  3 | Sophia     | Rossi     | sophia.rossi@student.example   |                   2 |            2023 | 3.92 | Ottawa      | 2005-07-21 | active    |               5000 |
|  4 | Noah       | Kim       | noah.kim@student.example       |                NULL |            2024 | 2.95 | Toronto     | 2006-01-09 | active    |               NULL |
|  5 | Isabella   | Okoro     | isabella.okoro@student.example |                   4 |            2021 |  3.1 | Hamilton    | 2003-05-30 | graduated |                  0 |
+----+------------+-----------+--------------------------------+---------------------+-----------------+------+-------------+------------+-----------+--------------------+
(showing 5 of 30 rows)
Hints3 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.