17
Sarah
Williams A-
0.00
Kizspy.me 6
30
Emily
Williams A+
0
0.00
7
32
Laura
Davis
A-
3
673.84
8
33
John
Taylor
A+
2
430.79
9
35
Jane
Moore
A+
0
0.00
10
50
Laura
Moore
A+
2
470.33
11
53
Chris
Davis
A-
1
202.86
12
56
Chris
Johnson A-
0
0.00
13 60
Michael
Wilson A+
2
606.28
14 69
Chris
Wilson A+
1
453.55
15 80
David
Williams A-
1
412.61
Picture 5.1
Question 6:
Write a query to identify, for each Specialty, doctors who have the highest sum of total billing
amount from appointments. The results must include Specialty, DoctorID, FullName,
SumOfTotalAmount, where the SumOfTotalAmount of each doctor is the sum of
TotalAmount of all billings from appointments of the doctor. Order the results by ascending
order of Specialty, then by ascending order of DoctorID for rows of the same Specialty as
follows:
Specialty
DoctorID
FullName
SumOfTotalAmount
12345
Cardiology
8
Dr. Michael Moore
1272.83
2
Dermatology 2
Dr. David Taylor
3656.38
3 General Surgery 4
Dr. Sarah Jones
1307.37
4
Neurology
23
Dr. Laura Miller
2591.39
5
Ophthalmology
13
Dr. Emma Jules
3882.68
6
Orthopedics
6
Dr. John Taylor
2440.93
7
Pediatrics
15
Dr. Emily Williams
2228.79
8
Psychiatry
14
Dr. John Wilson
1539.12
Picture 6.1
Question 7:
Zoom
Write a query to display the most common diagnoses given by each doctor with the
corresponding distinct patients that the doctor has diagnosed with each most common
diagnosis. The results must include DoctorID, DoctorFullName, Diagnosis, PatientID,
+ 95%
Close