Q. Answer the questions based on the table given below:
Table: HOSPITAL
SNo |
Name |
Age |
Department |
Dateofadm |
Charges |
Sex |
1 |
Arpit |
62 |
Surgery |
21-01-98 |
300 |
M |
2 |
Zareena |
22 |
ENT |
12-12-97 |
250 |
F |
3 |
Kareem |
32 |
Orthopaedic |
19-02-98 |
200 |
M |
4 |
Arun |
12 |
Surgery |
11-01-98 |
300 |
M |
5 |
Zubin |
30 |
ENT |
12-01-98 |
250 |
M |
6 |
Ketaki |
16 |
ENT |
24-02-98 |
250 |
F |
7 |
Ankit |
29 |
Cardiology |
20-02-98 |
800 |
F |
8 |
Zareen |
45 |
Gynaecology |
22-02-98 |
300 |
F |
9 |
Kush |
19 |
Cardiology |
13-01-98 |
800 |
M |
10 |
Shilpa |
23 |
Nuclear Medicine |
21-02-98 |
400 |
F |
(a) To list the names of all the patients admitted after 15/01/98.
(b) To list the names of female patients who are in ENT department.
(c) To list the names of all patients with their date of admission in ascending order.
(d) To display Patient's Name, Charges, Age for only female patients.
(e) Find out the output of the following SQL commands:
(i) Select COUNT(DISTINCT charges) from HOSPITAL;
(ii) Select MIN(Age) from HOSPITAL where Sex = "F";
Answer =
(a)
Select Name from HOSPITAL where Dateofadm > “150198” ;
(b)
Select Name from HOSPITAL where Department = “ENT” and Sex = “F” ;
(c)
Select Name Dateofadm from HOSPITAL order by Dateofadm ;
(d)
Select Name , Charges, Age from HOSPITAL where and Sex = “F” ;
(e)
(i)
Charges |
300 |
250 |
200 |
800 |
400 |
(ii)
MIN(Age) |
16 |
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )