Chapter 9 · Interview Level
12. Current Patient Age Calculation
Easy10 XPHealthcare
Calculate each patient's age in years as of '2025-01-01'. Return first_name, last_name, date_of_birth, and age. Order by age descending, 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.