Zoom
NumberOfAppointments corresponding to each doctor of two departments named jatrics' and 'General Surgery'; where NumberOfAppointments is the number of Completed' appointments in 2023 of each doctor. Order the results in descending order of NumberOfAppointments, then in ascending order of DoctorID for rows having the same NumberOfAppointments as in the following figure. Note that all doctors of these two departments must be displayed.
DoctorID
FirstName
LastName
DepartmentName
NumberOfAppointments
1
1
John
Doe
Pediatrics
2
2
8
Robert
Martinez
General Surgery 2
3
29
Melissa
Young
Pediatrics
2
4
40
Samuel
Carter
Pediatrics
2
5
48
Keith
Evans
General Surgery 2
6
50
Frank
Collins
Pediatrics
2
7
11
Jennifer
Wilson
Pediatrics
1
8
20
Helen
Thompson
General Surgery 1
9
23
Betty
Clark
Pediatrics
1
10
28
Christopher Hall
General Surgery 0
11
37
Laura
Baker
General Surgery 0
12
42
Katherine
Perez
General Surgery 0
Picture 5.1
5 of 5
Paper No: 4
Question 6:
Write a query to display, for each department, all the doctors who have the highest number of medical records. The results must include DepartmentID, Name, DoctorID,DoctorFullName and NumberOfRecords, where DoctorFullName is the concatenation of the doctor's first name, a whitespace and the doctor's last name. The NumberOfRecords of a doctor is the total number of medical records associated with that doctor.
DepartmentID
Name
DoctorID
DoctorFullName
NumberOfRecords
1
1
Cardiology
35
Rebecca Green
12
2
2
Neurology
14
Jessica Taylor
7
3
2
Neuroloav 31
Deborah Sanchez 7
+ 91%
Close