The Entity Relationship Model has describe some following steps are available here. There are
- Identify the entity
- Identify the attribute
- Find the relationship
- Identify other relevant attribute
- Draw complete E-R Diagram with all attribute including primary key
For understating these steps complete we take a example of a college database ..
- A collage have a many departments
- Each department has many courses
- Many instructor are working here
- An instructor work in only one department
- For each department has a one head
- A course can be taken by only one instructor
- A student can enroll for any number of course
- Each Course can have any number of course
Steps 1.– Identify the entity
- Department
- Student
- Course
- Instructor
These are the entity.
Step 2– Identify the attribute ––
- Department is the key attribute for the Entity “Department” as it identifies the department uniquely.
- Course is the key attribute for “course ” entity
- Student is the key attribute for ” student ” entity.
- Instructor name is the key attribute for ” instructor” entity
Steps 3- Find the relationships –
- One course is enrolled by multiple student and one student enrolls for multiple course, Hence cardinality between course and student is many to many.
- The department offer many course and each course belong to only one department hence the cardinality between department and course is one to many.
- One department has multiple instructors and one instructor belongs to one and only one department hence the cardinality between department and instructor is one to many.
- Each department there is a “head of department ” and one instructor is ” Head of department” hence the relationship is one to one.
- One course is taught by only one instructor,but the instructor teaches many courses hence the cardinality between course and instructor is many to one.
Step 4- Identify other relevant attribute-
- For the department entity the relevant attribute is location.
- for course entity course name ,duration,prerequisite.
- For instructor entity Room,mobile.
- For student entity. student name ,student id ,date of birth etc.