table name: tbl_schedule
tr_id(P.K.) mr_id(F.K.) sch_date doctor_id ----------- ----------- -------- ---------- 1 23 01/01/2012
This should be what you need:
SELECT mr_fname, mr_lname, COUNT(DISTINCT tr_id) FROM tbl_user LEFT JOIN tbl_schedule USING (mr_id) GROUP BY mr_id