Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

GRADE INCREASER A long time ago in a galaxy far far away... t is a period of civ

ID: 3666141 • Letter: G

Question

GRADE INCREASER A long time ago in a galaxy far far away... t is a period of civil war. Rebel rows, striking from a hidden table, have won their first victory against the evil Galactic Database. During the battle, rebel rows managed to steal a secret sql statement from the Database's ultimate weapon, the GRADE INCREASER, an update command able to help those in the class that are currently passing, but might be in need of a grade boost. EINGREASER .am upda command ab t Here's a table named "gradebook" that is in the database. name grade student1 student2 student3 73 45 86 87 79 student4 student5 Please help the rebel rows by writing an equivalent GRADE INCREASER Write an sql statement that will give additional bonus points to the class. However, we only want to give the points to those in the class that are already not failing (grade > 59). Create an UPDATE statement that will increase the grade of everyone in the class by 10 if they are currently passing (grade -60)

Explanation / Answer

SELECT name, grade, bonus =
CASE
WHEN grade > 59 THEN 'additional_bonus_point'
ELSE 0
END
FROM gradebook

UPDATE gradebook
SET grade = CASE
WHEN grade >=60 THEN (grade + 10)
ELSE grade
END