11 8
13 10
Emergency Medicine 43
Psychiatry
General Surgery 48
Justin Roberts
7
24
George Rodrigu... 10
Keith Evans 11
Picture 6.1
Question 7:
Write a query to display, for each department, the number of distinct patients who have appointments with a doctor in that department for the years 2022, 2023 and 2024. The results must include DepartmentID, Name, NumberOfPatientsIn2022,NumberOfPatientsIn2023 and NumberOfPatientsIn2024, as shown in the following figure.Note that all departments must be displayed in the results.
6 of 6
Paper No: 3
DepartmentID Name
NumberOfPatientsIn2022 NumberOfPatientsIn2023 NumberOfPatientsIn2024
1
1
Cardiology 5 Neurology 6
4
17
2
2
7
9
3
3
Pediatrics 5
8
13
4
4
Orthopedics 3
2
15
5
5
Dermatology 4
1
15
6
6
Radiology Oncology
2
2
6
7
7
1
3
Zoom
+ 94%
Close