Program: B.Tech Course: Cse2004 - Dbms Database Management Systems Lab Cycle Sheet 2
Program: B.Tech Course: Cse2004 - Dbms Database Management Systems Lab Cycle Sheet 2
Cycle Sheet 2
Hospital Database
In_Patient_Prescription(Pat_ID, Pres_ID)
Questions:
SQL queries with JOIN operation (Practice these queries with Cartesian product,
inner join, natural join etc.)
1. Find the HOD of doctor ‘Raghavan’ (Hint: you need to join the tables
DOCTOR and DEPARTMENT)
2. Find the list of all patients who were admitted in bed number ‘B101’
3. Display all the prescribed medicines of patient with Pat_ID ‘P101’
4. Display the test results of patient ‘Mani’
5. Display all bills of bill amount more than 10000 rupees and paid by the
patient ‘Steve’.
6. Find the category and address of the nurse who attended the patient with
pat_no ‘P220’.
7. Find the list of doctors who worked in the department which is started on or
after ’10-May-2018’.
8. Get the name of technicians who tests blood glucose level.
9. Display the details of all patients who were hospitalized between ’10-Mar-
2017’ and ’10-Apr-2017’
10. Display the in-patient prescription of the patient whose name is ‘Gayle’.
1. Find the number of doctors who are working in the department ‘D101’
2. Count the number of male patients who are treated by the doctor with doctor
id ‘D101’
3. Find the total bill paid by the patient ‘Karthik’
4. Find the name and address of the patient who paid the highest bill of all
patients.
5. Get the specialization of doctors whose name start with the letter ‘M’
6. Find the all the patients details whose name is exactly 5 characters long
7. Display the department names in ascending order
8. Get the gender wise count of patients.
9. Get the count of doctors for each specialization.
10. Get the total number tests conducted in any particular date.
1. All of the queries in “SQL queries with JOIN operation” section can be tried
with subqueries concept.
2. Display the list of doctors who are working in the department with more
number of doctors using sub-query and IN operator.
3. Find the name and id of all patients who are older than all the doctors in the
entire ‘cardiology’ department. Use subqueries and ALL operator.
4. Find the prescription ids of all prescription that included a medicine from the
brand ‘Ranbaxy’ using nested subqueries.
5. Find the list of patients who paid their bill through either ‘credit card’ or
‘debit card’ using subquery.
******************