You are on page 1of 3

In-class assignment 1 (10 points)

Name- Ali Akbar Ananto

ID- 1813519630

1. For each of the following pairs of related entities, indicate whether (under typical
circumstances) there is a one-to many, a many-to-many or a one-to-one relationship.
Then, using the shorthand notation or text notation, introduced in the text, draw a
diagram for each of the relationships.

 STUDENT and COURSE (students register for

courses) Many to Many Relationship

Courses Course ID Course Name Student ID


Student Student ID Student Name

 BOOK and BOOK COPY (books have copies)

One to Many Relationship

Copy
Book
Copy Category Edition Number Book ID
Book ID Book Name

 COURSE and SECTION (courses have

sections) One to Many Relationship

Section
Course Course ID Course Name
Section Number Course ID

 SECTION and ROOM (sections are scheduled in rooms)


One to Many Relationship

Room
Section
Room Number Time
Section ID Section Number
Section ID

 INSTRUCTOR and COURSE (instructors instruct courses)

Many to Many Relationship

Courses Course ID Course Name Instructor ID


Instructor Instructor ID Instructor Name

2. Following figure shows an enterprise data model (entity relationship diagram) for
a pet store
Please determine the following:

 What is the relationship between Pet and Store (one-to one, many-to-many, or
one-to-many)? Please explain.

Ans: The relationship between pet and store is one to many. The reason is the store
can contain multiple pets but one pet cannot be in multiple stores.

 What is the relationship between Customer and Pet? Please explain.

Ans: The relationship between customer and pet is one to many. One customer can
buy one or multiple pets, but one pet cannot be sold to multiple customers.

 Do you think there should be a relationship between Customer and Store? Explain
the reason if it YES or NO.

Ans: The relationship between customer and the store is one to many. Since here we
are talking about only the store, the store is singular and it servers multiple customers.

You might also like