Kizspy.me
Zoom
7 of 7
Paper No: 2
For example, when we call the F1 function in the following query, the results must be shown
as in the following figure:
select distinct Diagnosis, YEAR(RecordDate) as Year, dbo.F1(Diagnosis,
YEAR(RecordDate)) as NumberOfPatients
from MedicalRecords
where RecordDate < '2022-01-01'
Diagnosis
Year NumberOfPatients
1
Allergy
2019 3
2
Allergy
2020 4
3
Allergy
2021 2
4
Arthritis
2019 3
5
Arthritis
2020 1
6
Arthritis
2021 3
7
Asthma
2019 3
8
Asthma
2020 3
9
Asthma
2021 2
10
Diabetes
2019 3
11
Diabetes
2020 3
12
Diabetes
2021 6
13
Flu
2019 3
11
Clu
20201
+ 95%
Close