Unit 2
Unit 2
Information System
UNIT II SPATIAL DATA MODELS
9
Point
Polyline
Open Polyline
Closed Polyline
Polygon
Extent
ENTITY RELATIONSHIP
MODEL (ER MODEL)
The entity relationship (ER) model represents
the conceptual design of a database. The ER
diagram helps in understanding the components
of a database and relationships among them.
Entity Record
An entity is a real world item that exists on its
own. The set of all possible values for an entity
is the entity type. For example, a particular
student such as ‘Ravi Kumar’ is an entity record.
Student is the entity type in this case.
In ER diagram we show entity type as a
rectangle containing the type name.
Attribute
Properties that describe an entity
are known as its attributes. The
value of an attribute could be
expressed in numbers or in text.
In ER diagram attributes are
represented by ovals attached to
the entity by a line.
Attributes can be classified as:
Key attributes: An attribute whose
values are distinct for each individual
entity record and are used for
identifying an individual entity record
are known as key attributes.
For example in the student
entity type, StudentID is the key
attribute since no two students can
have same StudentID.
A key attribute is underlined in ER
diagram.
Non-key attributes : Attributes that are not unique
but are used to describe the entities are known as
non-key attributes. Names, age, address of a student
are the non key attributes.
Simple : Attributes that can’t be divided into
subparts are called simple attributes. For example
StudentID which is just a number is a simple
attribute.
Composite : Attributes that can be divided into
subparts with each subpart having their own
independent meaning are composite attributes. For
example Name of a student can be divided into two
parts i.e. first name and last name. This could be
illustrated by branching off the components of the
attribute.
Single valued: Attributes that can hold only
single value at a time are called single
valued attributes. Age of a student can’t
have more than one value and hence it is a
single valued attribute.
Multiple valued: Attributes that can have
more than one value are called multiple
valued attributes. For example the contact
number of a student can have two or more
than two phone numbers.
A multi valued attribute is shown as:
Derived attributes: The attributes that are
derived using a mathematical formula and
operations on other attributes are called derived
attributes.
Stored attributes: The attributes from which
another attributes can be derived are called stored
attributes. The age of a student can be calculated
by counting the number of years starting from his
date of birth to the present date. In this case age
is the derived attribute and date of birth is the
stored attribute. In ER diagram a derived attribute
is represented with a dotted oval and a line.
Relationship
A relationship is an association among entity types.
It is represented as a diamond in ER diagram.
For example an entity ‘student’ can be associated
with another entity ‘class’ as follows: