Build an executive dashboard with a single query. Using CTEs, compute: total_patients, total_doctors, total_visits, total_revenue (sum of billing amount), avg_revenue_per_visit (rounded to 2), and pct_completed_visits (rounded to 1). Return a single row with all metrics.
Schema
🔑idINT
first_nameTEXT
last_nameTEXT
date_of_birthTEXT
genderTEXT
emailTEXT
phoneTEXTNULL
blood_typeTEXT
cityTEXT
stateTEXT
🔗insurance_idINTNULL
created_atTIMESTAMP
postgresql
Run your query to see results
Press Ctrl + Enter to execute