Chapter 9 · Interview Level
10. Patient Contact Info with COALESCE
Easy10 XPHealthcare
Create a contact list where missing phone numbers display 'No phone on file'. Return first_name, last_name, email, and COALESCE(phone, 'No phone on file') as contact_phone. Order by last_name.
Tables
- PKidINT
- first_nameTEXT
- last_nameTEXT
- date_of_birthTEXT
- genderTEXT
- emailTEXT
- phoneTEXT
- blood_typeTEXT
- cityTEXT
- stateTEXT
- FKinsurance_id→ insurance.idINT
- created_atTIMESTAMP
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.