You are on page 1of 2

Air University

Department of Cyber Security


(Mid-Term Examination: Spring 2021)

Subject: Database Systems Total Marks: 60


Course Code: CS230 Date: Thursday, 20th May
Class: BS-CYS-IV Time: 9:00 AM
Section: A Duration: 2 Hours
FM Name: Dr. Mohammad Imran

Note:
1. This is a CLOSED book/notes exam
2. This examination carries 20% weight towards the final grade
3. This paper consists of TWO (02) questions and you are required to attempt BOTH of them
4. You will attempt the questions in hand-writing on your own answer sheets, and upload your
answer sheets in PDF format
5. Before submitting, make sure that every page is numbered and pages are in correct order
6. You MUST provide your name, student ID, course code, title, and signatures on EVERY
PAGE
7. The first page must also include the following oath/declaration, along with your signatures:
“I solemnly affirm that I shall neither help anyone, nor seek help
from anyone, in attempting this exam”
8. The exam duration INCLUDES the time for uploading of your hand-written answer sheets.
You are advised to manage your time properly, so that you have at least 15-20 minutes for
uploading your answer sheets
 Late submissions will not be accepted UNDER ANY CIRCUMSTANCES

Q. 1. Read the given scenario carefully, and answer parts (a) and (b) (total marks: 40)

“Builders build houses through contractors. Each builder and contractor is registered with a unique name,
and has an address and phone number. Each house has a plot size, and has a specific address which consists
of Plot No., Street and City. Each house can be single unit or double unit. Each house has a construction cost
which includes material costs, labor costs, and contractor fee which is equal to 5% of total material and labor
costs. A particular house is built by only one contractor for only one builder, but a builder builds many
houses through different contractors.

Builders sell houses to customers, who can pay the full price in lump sum or lease through a bank. For bank
lease, the monthly payment is calculated by dividing the total price of house by the number of installments
plus a 7.5% mark up. Customers can be of type individuals or corporations. An individual customer has a
CNIC, name, address and phone number, while a corporation has a name, SECP registration number,
business type, address and phone number.”

(a) Draw ERD/EERD for the above scenario. Show all entity types, their relationships, relationship
attributes (if any), relationship cardinalities, composite and derived attributes, etc. (20 marks)
(b) Derive relational model from the ERD/EERD. Show all relational schemas, including attributes, primary
and foreign keys. (20 marks)

Page 1 of 2
Q. 2. For the relational model shown below, answer parts (a) and (b) (total marks: 20)

Supplier
S_ID S_Name S_Address

Part
P_ID P_Description P_Price

Suplier_Part
P_ID S_ID

Project
Pr_ID Pr_Title Pr_Starting_Date

Supplier_Part_Project
S_ID P_ID Pr_ID Qty

(a) Write down relational algebra operations and corresponding SQL queries to retrieve the following
information:
i. Show description of all parts that have price less than 50 (2 marks)
ii. Show names of all suppliers who provide the part with ID „P-124‟ (4 marks)
iii. Show project title and start dates for all projects that have used the part whose description is
„Power Supply‟ (6 marks)

(b) Write down SQL queries to retrieve the following information:


i. Show the name of the supplier who provided most parts for the project titled „Mohmand Dam‟
(4 marks)
ii. For each project, show project ID and the total price of all parts used in that project (4 marks)

***************** End of Question Paper *********************

Page 2 of 2

You might also like