You are on page 1of 1

Lahore College for Women University, Lahore

Final Term Examinations 2021


Class: BS CS (Semester III)
Subject: Computer Science
Course Title: Database Systems
Time: 2 hours 30 minutes Total Marks: 55 (45Sub+10Obj)
SUBJECTIVE (45 Marks)

Question 1: Draw an ER diagram for the given scenario (10 marks)


Suppose that you are designing a schema to record information about Netflix shows on TV. Your
database needs to record the following information:
 Each Netflix show has a name, genre, basic_info and viewer’s name. Any Netflix show has at
least two or more viewer.
 Each producer has a company name, company country. A show is produced by exactly one
producer. One producer produces exactly one show.
 Each television has a name, start year, head office.  A television may broadcast multiple
shows. Each show is broadcasted by exactly one television.
 Each user has a username, password, phone number, and age. A user may rate multiple
shows, and a show may be rated by multiple users. Each rating has a score of 0 to 10.

Draw the ER diagram for the above scenario, providing degrees and cardinalities. Highlight
primary keys, composite attributes, multivalued attributes, and derived attributes, if any. Also
show strong, weak entities, if any.

Question 2: What are Joins? Discuss the types of joins with examples. (6 marks)

Question 3: Consider the following relations: (9 marks)


Doctor (NIC, FirstName, LastName, Specialty, YearsOfExperience, PhoneNum)
Patient (NIC, FirstName, LastName, Address, DOB, PrimaryDoctor_NIC)
Medicine (TradeName, UnitPrice, MedicineType) *MedicineType = allopathic, homeopathic
Prescription (Id, Date, Doctor_NIC, Patient_NIC)
Prescription_Medicine (Prescription Id, TradeName, NumOfUnits)

Write SQL queries for the following:


(a) List the trade name of medicine type with unit price less than 500 PKR.
(b) List the last name of patients whose primary doctor name ends with ‘a’.
(c) For medicines written in more than 5 prescriptions, report the trade name and the total
number of units prescribed.

Question 4 (20 marks- 4 marks each)


(a) Differentiate between normalization and denormalization.
(b) Discuss the three types of anomalies.
(c) What are SQL Cursors?
(d) Differentiate between data authentication and data authorization.
(e) Discuss 3 methods of database backup.

You might also like