0% found this document useful (0 votes)
109 views5 pages

ER Diagram Rules

The document outlines the process of creating an Entity Relationship Diagram (E-R diagram) based on business rules, emphasizing the importance of these rules in designing computerized databases. It explains key concepts such as entities, attributes, and relationships, and illustrates how to represent them graphically. Additionally, it discusses the significance of primary keys and composite keys in database design.

Uploaded by

darshan2299dy
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)
109 views5 pages

ER Diagram Rules

The document outlines the process of creating an Entity Relationship Diagram (E-R diagram) based on business rules, emphasizing the importance of these rules in designing computerized databases. It explains key concepts such as entities, attributes, and relationships, and illustrates how to represent them graphically. Additionally, it discusses the significance of primary keys and composite keys in database design.

Uploaded by

darshan2299dy
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/ 5

Creating Entity Relationship Diagram using

business rules
1. Introduction

2. Business rules
Most organizations are guided by several rules obtained from their policies, regulations, best
practices etc specific to the business. Business rules related to the relevant data in the business are
essential for designing computerized database.

For example - Suppose a university offers several courses for a program of study. Students can
register in one academic year for zero or more courses. That mean a student may not register for
any course. Courses may also exist without any student registered for that course.

We can derive following business rule statements from the above example.

# A student may register in one academic year for zero or more courses.
# A course may obtained by one or more students.
# Student obtain a mark for a registered course.

Following rules also need to consider when designing a computerized database.

# A student has a registration no which is a primary key. It should unique and not null.
# A course has a course code which is a primary key. It should unique and not null.

2. Entity Relationship Model


Entity Relationship Model (E-R model) is a detailed logical representation of the data for
an organization or for a business area. The E-R model is expressed in terms of entities in the
business environment, the relationships among those entities, and the attributes of both entities and

1
their relationships. An ER model is normally expressed as an entity relationship diagram (E-R
diagram) which is a graphical representation of an ER model.

3. Entity Relationship Diagram (E-R diagram)


Consider the following business rule.

“A student may register for zero or more courses”.

This statement has 2 nouns which are student and course. Now try to create an entity relationship
diagram for first business rule. Student and course are nouns in the above diagram and are called
entities. Register is a verb and is called the relationship between entities. For simplifying the
diagram attributes are omitted.

relationship

student register course

entity

4. Entity Relationship Model Constructs


The basic constructs of the entity relationship model are entities, relationship and attributes.

4.1. Entity
An entity is a person, place, object, event or concept in the user environment about the which the
organization wishes to maintain data.
For example, student

Student, course in the above example, are called entities. It is represented by a rectangle box.

4.2. Attributes

Registration no address

name student

gender
age

2
Properties of student entity such as student name, address are called attributes of the student entity.
An attribute is represented by an ellipse. Here “registration no” attribute is underlined. It is a called
a primary key. Primary key should be unique and not null. Primary key is very essential in
computerized database because data in computerized database can be accessed only through
primary keys.

4.3. Relationship and its attributes


Relationships are represented by diamond-shaped box. Name of the relationship is written
inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to
it by a line.In this example, “registration year” cannot be included for either course or student. It can
included to relationship register.

register

Registration
year

5. Entity Relationship diagram (E-R diagram) with


Attributes
ER diagram binds entities, relationships and attributes all together.

Course
Registration no address code

Course
name student register course
title

gender Registration credit


age
year

symbol in the above diagram represents the many to many relationship, since one
student may register for more than one course and one course can be obtained by more than on
student.

3
You can study with following diagram. We called this type diagram as occurrence diagram.
According to the occurrence diagram, Nimali has registered for ECX3217, ECX3150 and TTI3211.
This relationship is 1 to many. But ECX3217 course has obtained by both Nimali and Kamal.
Therefore this relationship is many to one. Considering both sides, relationship is many to many.

In this figure, Malith has not register for any course in


this year. And the TTC3213 course has not obtained
by any student.

Normally, there are 4 types of relationships.

So, student course entity relationship diagram in the above should be changed as follows.

Now teachers need to record marks for the registered course. So the “mark” attribute should be
added to the “register” relationship. This mark appears in “mark sheet”. This mark sheet becomes
an “associative entity” for the “register” relationship. So, the ER diagram should be changed
according to the following ER diagram.

4
Mark sheet associative entity can be accessed by combinations of registration no, course code and
registration year. Key with combination of other attributes are called composite key.

The above ER diagram can be described by following occurrence diagram. For writing easily,
instance of entities are named as s1, s2,.... etc. In the following diagram line from s2 is connected to
m2 and again it is connected to m3. This type of connections are called 1 to many.

You might also like