Computer Science
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 ;
DDL & DML
4 Likes
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;
Answered By
2 Likes
Related Questions
Write Query statements for following transaction : (Consider tables of question 12)
- Increase price of all products by 10%.
- List the details of all orders whose payment is pending as per increased price.
- Decrease prices by 10% for all those products for which orders were placed 10 months before.
Modify table Empl, add another column called Grade of VARCHAR type, size 1 into it.
Add a constraint (NN-Grade) in table Empl that declares column Grade not null.
Insert a record of your choice in table Empl. Make sure not to enter Grade.