Kizspy.me
234567822222222
12
13
14
15
16 15
55555
Dr. David Wilson
Asthma
40
Emily Taylor
15
Dr. David Wilson
Dr. David Wilson
Dr. Emily Williams
Asthma
Asthma
46
Jane Wilson
63
Sarah Johnson
Diabetes 59
Emily Moore
Dr. Emily Williams
Diabetes 65
Jane Miller
17
11
18
19
20
21
FFFF2222
11
Dr. Emma Johnson Arthritis 57
Dr. Emma Johnson Diabetes 72
11
Dr. Emma Johnson
Flu
11
Dr. Emma Johnson
Infection
11
Dr. Emma Johnson Migraine 54
24
Dr. Emma Jones
Diabetes
24
Dr. Emma Jones
Diabetes 66
24
Dr. Emma Jones
24
Dr. Emma Jones
Migraine
Migraine
13
Dr. Emma Jules
Diabetes 2
22386 2 2 N
James Davis
Michael Moore
49
David Wilson
33
John Taylor
Sarah Wilson
Jane Williams
Emma Smith
42
James Davis
63
Sarah Johnson
Sarah Johnson
Picture 7.1
Question 8:
Create a function named F1 which calculates and returns an integer number which is the
number of distinct patients who have been diagnosed a given diagnosis in a given year
(based on the RecordDate), where Diagnosis nvarchar(255) and year int are respectively the
first and the second input parameters of the function.
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
Zoom
- FUO
+ 100%
Close