六.Using Null
5.Use COALESCE to print the mobile number. Use the number '07986 444 2266' if there is no number given. Show teacher name and mobile number or '07986 444 2266'
select name,coalesce(mobile,'07986 444 2266') from teacher
9.Use CASE to show the name of each teacher followed by 'Sci' if the teacher is in dept 1 or 2 and 'Art' otherwise.
select name,
case when dept in(1,2) then 'Sci'
else 'Art'
end
from teacher
10.Use CASE to show the name of each teacher followed by 'Sci' if the teacher is in dept 1 or 2, show 'Art' if the teacher's dept is 3 and 'None' otherwise.
select name,
case when dept in(1,2) then 'Sci'
when dept in(3) then 'Art'
else 'None'
end
from teacher