Page 114 - PYTHON-12
P. 114
(q) To insert a new row in the HOSPITAL table with the following data:
(11,'Mustafa',37,'ENT','1998-02-25',250,'M')
insert into hospital values(11,'Mustafa',37, "ENT", "1998-02-25",250,
"M");
Give the output of the following SQL statements based on the above table -HOSPITAL.
(i) Select count(distinct charges) FROM Hospital;
count(distinct charges)
3
(ii) Select MIN(Age) From Hospital WHERE Sex='M';
MIN(Age)
450
(iii) Select AVG(Charges) FROM Hospital where DateofAdm <
’1998-02-12’;
AVG(Charges)
387.5
(iv) Select SUM(Charges) FROM Hospital where Sex =’F’;
SUM(Charges)
1600
(v) Select Name FROM Hospital where Department IN (‘ENT’,
’Orthopedic’);
Name
Ravina
Karan
Zubina