Q. 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
Table ---
Answer =
update Empl
set grade = 1
where sal between 700 and 1500 ;
update Empl
set grade = 2
where sal between 1500 and 2200 ;
update Empl
set grade = 3
where sal between 2200 and 3000 ;
update Empl
set grade = 4
where sal = 3000 ;
Can we write it in a single query?
ReplyDeleteYes, but it is out of our syllabus.
Deleteadd the next button
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )