Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

COMSATS University Islamabad, Sahiwal Campus

Course Title: Database Systems Course Code: CSC270 Credit Hrs 3,1
Course Instructor: Syed Nasir Mehdi Programme Name: BSE, BCS
Semester: 04,5 Batch: Section: Deadline 11th Mar, 2024
Time Allowed: Maximum Marks: 10
Student’s Name: Reg. No. CIIT/ /SWL
CLO/SO CLO 2- SO 2
Important Instructions / Guidelines:
Read the question paper carefully and answer the questions according to their statements.
Take care of the deadline.

Assignment 2

Q 1. Express these scenarios through ERDs

SCENARIO 1
1. Customer has a relationship with items.
2. A Customer may or may not order items.
3. On the other hand, At least one or more than one item is ordered by a customer.
4. Attributes of CUSTOMER include CUSTOMER_NAME, CUSTOMER_ADDRESS, and CUS-
TOMER_EMAIL.
5. Similarly, items include attributes such as ITEM_NAME and ITEM_PRICE.

SCENARIO 2
1. In this entity relationship model, there are two entities. Relation one is developer creates a web-
site the second one is visitor visits a website.
2. A developer may or may not create a website also one or more than one website is visited by the
one or more visitors.
3. Similarly, we can say a visitor visits one or more than one websites.

SCENARIO 3
1. In this entity relationship model, there are two entities. Relation one is books written by author
and the other one is books are published by publisher.
2. One or many books are written by author or we can say author may or may not write one or
many books.
3. Similarly, one or many books are published by at least one publisher.
4. Attributes of author are NAME, ADDRESS, and URL.
5. Attributes of books are TITLE, YEAR, and PRICE.
6. Similarly, attributes of publisher include NAME, ADDRESS AND PHONE.
SCENARIO 4
1. In this entity relationship model, there are three entities. Relation one is department run by su-
pervisor, the other one is department is assigned employee and the last one is employee works
on project.
2. One and only one department is run by at least one supervisor.
3. One or more than one departments are assigned to one or more than one employees.
4. One or more than one employee works on more than one project, or may not work on the
project.
5. Attribute of department is DEPARTMENT- NAME , attribute of employee is EMPLOYEE -
NAME.
6. Similarly, attribute of project is PROJECT- NUMBER and supervisor is SUPERVISOR- NUM-
BER.

SCENARIO 5
1. In a hospital one doctor may care many patients or may be he doesn’t have any patient.
2. In hospital a single room can be occupied by many patients but one patient can occupy
only one room or no room.
3. One doctor can write many prescriptions but it is possible that there is no patient for pre-
scription. But one prescription can be written by only one doctor
4. Single prescription contains exactly one drug. But same drug is suggested in many pre-
scriptions.
5. Patient should have at least one prescription or may have many prescriptions from differ-
ent doctors, but one prescription is received by only one patient.
6. A nurse supervises all nurse or she may not manage any of nurses but one nurse can be
managed by nurse or may be she is managed by other authority.
7. Single room can be staffed by one or many nurses , but one nurse staffed in only one room.

You might also like