Advanced Practice Problems - Mixed-up Code¶
Let’s practice what we have learned about SQL.
In the grades table:
Create a SELECT statement to retrieve the student_id, test_name,
and english for all entries whose english value is lower than 60 and math value is higher than 90.
In the grades table:
A student completed an extra assignment and got some additional points.
Create an UPDATE statement to change the entry with a student_id of 1 and set the math score for the test_name of final to 90.
In the grades table:
One test was too difficult so the instructors decided to give everyone extra points.
Create an UPDATE statement to add 10 points to the english score
of the entries with a test_name of midterm
In addition to the grades table:
there is also a students table:
Create a SELECT statement with a JOIN to: select the test_name and math
from the grades table and name from the students table, where the student_id
in the grades table is the same as the id in the students table.
In addition to the grades table:
there is also a students table:
Create a SELECT statement with a JOIN to: select the date and name
from the tests table and student_id from the grades table,
where the test_name in the grades table is the same as the name
in the tests table.