Find visits where the patient's responsibility exceeded the insurance-covered portion. Return the patient's full name, visit_date, amount, insurance_covered, patient_responsibility, and the difference (patient_responsibility - insurance_covered) as overpay_gap. Only include rows where the gap is positive. Sort by overpay_gap 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