Tables: Doctors
, Patients
, Appointments
, Bills
.
- Tasks: Most visited doctor, patients with unpaid bills, daily appointments report.
SELECT d.DoctorName, COUNT(a.AppointmentID) AS TotalAppointments
FROM Doctors d
JOIN Appointments a ON d.DoctorID = a.DoctorID
GROUP BY d.DoctorName
ORDER BY TotalAppointments DESC;
Leave a Reply