0% found this document useful (0 votes)
27 views

Lab Final Exam Section B: Instructions

The document provides instructions for a lab final exam in database systems. It consists of 5 questions worth various point values totaling 35 points. It instructs students to run a script to create tables and populate data for a hospital management system. It provides some details on the data, such as department IDs and days of the week. The questions involve creating views, finding special patients of doctors, identifying highest earning doctors, populating a notification table for patient appointments, and writing a function to find supervisor names.

Uploaded by

SAAD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Lab Final Exam Section B: Instructions

The document provides instructions for a lab final exam in database systems. It consists of 5 questions worth various point values totaling 35 points. It instructs students to run a script to create tables and populate data for a hospital management system. It provides some details on the data, such as department IDs and days of the week. The questions involve creating views, finding special patients of doctors, identifying highest earning doctors, populating a notification table for patient appointments, and writing a function to find supervisor names.

Uploaded by

SAAD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CS Database Systems

Spring 2016

Lab Final Exam


Section B
Instructions:

Total Time: 90Minutes

Total Marks: 35
Run script file LabFinal.sql to create tables and populate data of a Hospital
management system.
dept is department id in Doctor table. Day_of_week is Monday, Tuesday etc.
Phone is mobile phone number of patient.

Question 1

Marks 5

Create a view to give the name(s) of the oldest patient(s) along with the total fees
that patient has paid so far.

Question 2

Marks 8+2

Find name of Very Special Patient/Patients of the year of any given doctor.
Note: A special patient is one who has only ever consulted with that doctor if
consulted ever.
Provide reason why you used View/Trigger/Stored Procedure or UDF for this.

1
Farrah Munir

CS Database Systems

Question 3

Spring 2016

Marks 5

Give the name/names of the highest earning doctor/doctors for every month of
each year.

Question 4
Notification (Patient_id ,Phone,
Doctor_id,AppointmentDate,StartTime,Timestamp)

Marks 10

Assume we have created an SQL Server job task that reads Notification table daily
at 8am and sends sms to patients about their due appointment on that day if any.
Implement logic to populate Notification table whenever an appointment is
scheduled.
Note: GetDate() in sql returns current timestamp.

Question 5

Marks 5

Write a function to find the name of immediate supervisor for any given doctor id.

2
Farrah Munir

You might also like