Teacher Department Data
5. Show teacher name and mobile number or '07986 444 2266'
Use COALESCE to print the mobile number. Use the number '07986 444 2266' if there is no number given.
COALESCE takes any number of arguments and returns the first value that is not null.
We can also use CASE WHEN:
9. show the name of each teacher followed by 'Sci' if the teacher is in dept 1 or 2 and 'Art' otherwise
Using CASE operator:
Using IF() function:
Last updated