CBSE Class 12 Computer Science Question 63 of 79

Table Creation and Data Manipulation Commands — Question 9

Back to all questions
9
Question

Question 9

In the added column Grade, assign grades as follows :

if sal is in range 700 — 1500, Grade is 1 ;
if sal is in range 1500 — 2200, Grade is 2 ;
if sal is in range 2200 — 3000, Grade is 3 ;
if sal is in range 3000 — Grade is 4 ;

Answer
UPDATE Empl
SET Grade = '1'
WHERE Sal >= 700 AND Sal <= 1500;

UPDATE Empl
SET Grade = '2'
WHERE Sal > 1500 AND Sal <= 2200;

UPDATE Empl
SET Grade = '3'
WHERE Sal > 2200 AND Sal <= 3000;

UPDATE Empl
SET Grade = '4'
WHERE Sal > 3000;