0% found this document useful (0 votes)
9 views6 pages

Assignment 1 Comp 230

The document outlines the design of three management systems: Library, Hospital, and Restaurant. Each system includes entities with specific attributes and relationships, ensuring data integrity and efficient operations. Additionally, it discusses normalization principles to maintain database structure and efficiency.

Uploaded by

vrindavksraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views6 pages

Assignment 1 Comp 230

The document outlines the design of three management systems: Library, Hospital, and Restaurant. Each system includes entities with specific attributes and relationships, ensuring data integrity and efficient operations. Additionally, it discusses normalization principles to maintain database structure and efficiency.

Uploaded by

vrindavksraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Assignment – 1

COMP 230

Sankalp Kumar Sharma


300216392
QUESTION 1:

Relational Schema for Library Management System

The Library Management System is built around three main entities: Books, Members, and
Borrowing, each with specific attributes and constraints to ensure data integrity and
efficient management.

1. Books

• Attributes:

o Book ID – Unique identifier for each book (Primary Key).

o Title, Author, Publisher – Essential details, cannot be null.

o ISBN – Unique code for every book (Unique Constraint).

2. Members

• Attributes:

o Member ID – Unique identifier for each member (Primary Key).

o Name – Required field to identify members.

o Address – Stored as text to accommodate detailed information.

o Phone – Stored as a VARCHAR to support various formats, including country


codes.

3. Borrowing

• Attributes:

o Transaction ID – Unique identifier for each borrowing event (Primary Key).

o Book ID – Links to the Books table (Foreign Key).

o Member ID – Links to the Members table (Foreign Key).

o Borrow Date – Required field that records when the book was borrowed.

o Return Date – Can be left empty if the book has not yet been returned.

Assumptions:

• Book ID and Member ID can be stored as VARCHAR.


• ISBN must be unique to avoid duplicate book entries.
• Phone numbers are stored as text to support different country formats.
• Return Date is optional, allowing flexibility for ongoing borrowings.

QUESTION2: Hospital Management System

In the ER diagram, the Dr_and_Patient relationship is one-to-many, meaning a doctor can


treat multiple patients, but each patient is assigned to only one primary doctor. The Test
relationship is many-to-many, as a patient can undergo multiple tests, and the same test
can be taken by multiple patients. Lastly, the Performed_By relationship is also many-to-
many, indicating that a doctor can perform multiple tests, and a test can be conducted by
multiple doctors. These relationships help structure the interaction between doctors,
patients, and medical tests efficiently within the system.

Entities & Attributes:

1. Patient:

o SS# (Social Security Number)

o Name

o Insurance

o Admitted Date

o Check-out Date
2. Doctor

o Drs# (Doctor ID)

o Name

o Specialization

3. Test

o ID (Test ID)

o Name of Test

o Result

o Date

o Time

QUESTION 3:

To satisfy First Normal Form (1NF), a table must meet two criteria: each cell must hold a
single, indivisible value (atomicity), and each row must have a unique identifier. The table
shown in the diagram meets these conditions. However, for the table to comply with
Second Normal Form (2NF), it must first be in 1NF and must not have partial
dependencies. This means that no non-key attribute should depend only on part of a
composite primary key. Since the composite primary key for this table is (SS#, Test ID), we
need to ensure that all non-key attributes are dependent on the entire composite key and
not just one part of it. If this condition is met, the table adheres to 2NF.
QUESTION 4: Restaurant Management System

This ER diagram models a Restaurant Management System, covering order processing,


staff coordination, and customer service. It helps in tracking orders, assigning staff, and
managing payments effectively.

Entities and Their Attributes

1. Customer

• Attributes: Name, Address, Contact No.

2. Restaurant

• Attributes: Name, Contact No., Address

3. Manager

• Attributes: Name, ID No., Contact No.

4. Waiter

• Attributes: Name, ID No.


5. Order

• Attributes: Order ID, Order Details

6. Items

• Attributes: Item ID, Name, Price, Description

7. Table

• Attributes: Table Number, Capacity

8. Chef

• Attributes: Name, ID No.

9. Bill

• Attributes: Bill ID, Total Amount

10. Cashier

• Attributes: ID No., Name

You might also like