26 8
Dr. Michael Moore
65
Metformin
1 pill daily
2020-09-08 00:00:00.000 21
Laura Smith
Kizspy.me 27
17
Dr. Sarah Brown
NULL
NULL
NULL
NULL
NULL
NULL
28 20
Dr. Sarah Davis
NULL
NULL
NULL
NULL
NULL
NULL
29 4
Dr. Sarah Jones
298
30 4
Dr. Sarah Jones
299
31 19
Dr. Sarah Williams NULL
Amoxicillin
Ibuprofen
NULL
Apply topically
2020-07-23 00:00:00.000 50
Laura Moore
NULL
Inject once a week 2020-07-23 00:00:00.000 50
NULL
Laura Moore
NULL
NULL
Picture 4.1
Zoom
Question 5:
Write a query to display PatientID, FirstName, LastName, BloodType,
NumberOfAppointments, SumOfBilling TotalAmount for all patients having the BloodType
'A+' or 'A-'; where, for each patient:
-NumberOfAppointments is the total number of appointments in 2020 and 2021 (based on
AppointmentDate) of the patient.
- SumOfBilling TotalAmount is the sum of TotalAmount of all billings for appointments in 2020
and 2021 (based on AppointmentDate) of the patient.
Note that the NumberOfAppointments = 0 and SumOfBilling TotalAmount = 0 if the patient
has no appointment with the AppointmentDate in 2020 or 2021.
Close
+ 95%