Zoom
5 of 5
Paper No: 11
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
Neurology 31
Deborah Sanchez 7
4
3
Pediatrics 1
John Doe
10
5 4
Orthopedics 12
David Anderson
7
6
5
Dermatology 4
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 30
Anthony Allen
7
11 8
Emergenc... 43
Justin Roberts
8
12 9
Psychiatry 24
George Rodrigu... 4
13 10
General S... 48
Keith Evans
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 2020 in the 'Cardiology' department is 915. Note that the TotalCost for a given department in a given vear must be NIILI if no test was performed in that year for annointments in that
+ 100%
Close