100% found this document useful (1 vote)
399 views

Entity Relationship Examples

The document describes designing an entity relationship model for a college database. It identifies the key entities as Department, Course, Instructor, and Student. It then identifies the relationships between the entities, including that departments offer courses in a one-to-many relationship, departments have instructors in a one-to-many relationship, departments have a single head in a one-to-one relationship, courses can be taken by students in a many-to-many relationship, and courses are taught by instructors in a many-to-one relationship. Finally, it identifies key attributes for each entity.

Uploaded by

bhaskar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
399 views

Entity Relationship Examples

The document describes designing an entity relationship model for a college database. It identifies the key entities as Department, Course, Instructor, and Student. It then identifies the relationships between the entities, including that departments offer courses in a one-to-many relationship, departments have instructors in a one-to-many relationship, departments have a single head in a one-to-one relationship, courses can be taken by students in a many-to-many relationship, and courses are taught by instructors in a many-to-one relationship. Finally, it identifies key attributes for each entity.

Uploaded by

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

Entity Relationship (ER) Modeling-Example

Here we are going to design an Entity Relationship (ER) model for a


college database. Say we have the following statements.

1. A college contains many departments


2. Each department can offer any number of courses
3. Many instructors can work in a department
4. An instructor can work only in one department
5. For each department there is a Head
6. An instructor can be head of only one department
7. Each instructor can take any number of courses
8. A course can be taken by only one instructor
9. A student can enroll for any number of courses
10.Each course can have any number of students
Good to go. Let's start our design.(Remember our previous topic and the
notations we have used for entities, attributes, relations etc )

Step 1 : Identify the Entities


What are the entities here?

From the statements given, the entities are

1. Department
2. Course
3. Instructor
4. Student
Stem 2 : Identify the relationships

1. One department offers many courses. But one particular course can be
offered by only one department. hence the cardinality between department
and course is One to Many (1:N)
2. One department has multiple instructors . But instructor belongs to only
one department. Hence the cardinality between department and instructor
is One to Many (1:N)
3. One department has only one head and one head can be the head of only
one department. Hence the cardinality is one to one. (1:1)
4. One course can be enrolled by many students and one student can enroll for
many courses. Hence the cardinality between course and student is Many to
Many (M:N)
5. One course is taught by only one instructor. But one instructor teaches
many courses. Hence the cardinality between course and instructor is Many
to One (N :1)
Step 3: Identify the key attributes

 "Departmen_Name" can identify a department uniquely. Hence


Department_Name is the key attribute for the Entity "Department".
 Course_ID is the key attribute for "Course" Entity.
 Student_ID is the key attribute for "Student" Entity.
 Instructor_ID is the key attribute for "Instructor" Entity.
Step 4: Identify other relevant attributes

 For the department entity, other attributes are location


 For course entity, other attributes are course_name,duration
 For instructor entity, other attributes are first_name, last_name, phone
 For student entity, first_name, last_name, phone
Step 5: Draw complete ER diagram
By connecting all these details, we can now draw ER diagram as given below.

You might also like