The CFO wants to compare revenue across insurance plan types. Join billing through visits and patients to insurance. Return plan_type, total_billed (sum of billing amount), and total_covered (sum of insurance_covered), both rounded to 2 decimals. Order by total_billed descending.
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