- Display doctorid, dname, total fees received by the doctor(s) who have treated more than one patient?
- Display hospitalid, hname, htype of hospital(s) which has the highest number of doctors associated with them.
table 1 – patient
patientid pname address amount ptype
table 2 – hospital
hospitalid hname htype
table 3 – doctor
doctorid dname specialization hospitalid status
table 4 – billing
billingid patientid doctorid fees billdate
So far this is what I have:
sum (fees) as totalfees,
doctor.doctorid = billing.doctorid
min ( billing.patientid ) <> max ( billing.patientid )