DBI202_-_FA_2024_-_PE_-_s_-_12_2891.webp
Pride2003

DBI202_-_FA_2024_-_PE_-_s_-_12_2891.webp

4
4
Orthopedics 3
2
15
5
5
Dermatology 4
1
15
6
6
Radiology
2
2
6
7
7
Oncology 1
3
8
8
8
Emergenc... 6
5
10
9
9
Psychiatry 0
1
6
10 10
General S... 10
6
12
Question 8:
Picture 7.1
Create a function named F1 which calculates and returns an integer number which is the number of distinct patients having appointments with doctors of a given department, where departmentID int is the input parameter of the function.
For example, when we call the F1 function in the following query for calculating the number of distinct patients having appointments with the two departments 'Cardiology' and 'Pediatrics', the results must be shown as in the following figure:
select DepartmentID, Name, dbo. F1 (DepartmentID) as NumberOfPatients
from Departments
where Departments. Name in ('Cardiology', 'Pediatrics')
DepartmentID
Name
NumberOfPatients
1
1
Cardiology
37
2
3
Pediatrics
32
Zoom
+ 100%

Close
Chưa có bình luận nào.

Thông tin

Category
DBI202
Thêm bởi
Pride2003
Ngày thêm
Lượt xem
920
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
DBI202_-_FA_2024_-_PE_-_s_-_12_2891.webp
File size
209 KB
Dimensions
1920px x 803px

Share this media

Back
Bên trên Bottom