Zoom
Write a query to display, for each department, all the doctors who have the highest number 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.of medical records. The results must include DepartmentID, Name, DoctorID,
DepartmentID Name
1
1
2
2
Cardiology 35
Neurology 14
DoctorID DoctorFullName
Rebecca Green
NumberOfRecords
12
Jessica Taylor
7
3
2
Neurology 31
Deborah Sanchez 7
4
3
Pediatrics 1
John Doe
10
5
4
6
5
Orthopedics 12
Dermatology 4
David Anderson
7
Michael Williams
5
7
5
Dermatology 32
Joshua Wright 5
8 5
Dermatology 39
Virginia Nelson
5
9
6
Radiology 49
Sharon Edwards 7
10 7
Oncology
11 8
30
Emergenc... 43
Anthony Allen
7
12
9
13 10
Psychiatry
General S...
24
48
Justin Roberts
George Rodrigu... 4
Keith Evans
8
10
Picture 6.1
Question 7:
Write a query to display, for each year of the appointments table, the total cost of tests conducted for appointments in this year of each of the five departments: 'Cardiology',
'Neurology', 'Pediatrics', 'Dermatology' and 'Oncology'. The results must include DepartmentID, Name, Year and TotalCost as shown in the following figure. For example, the first row in the figure indicates that the total cost for tests conducted for appointments in
+ 100%
Close