You are on page 1of 20

CSC241 Database Systems

Lecture # 8
By
Maria Gul

1
Components of ER Model
2. Attributes
• The characteristics of an entity are called
attributes.
• E.g., Name, Address, Class and Email of a
student are his attributes.
• All instances of a particular entity class have
same attributes.
• E.g., all students of STUDENT entity class
have the attribute Name, Address, Class and
Email.

2
Components of ER Model
2.1 Attribute Domain
• An attribute domain is a set of possible
values for an attribute.
• All attributes have domain.
• Domains may consist of range of values or
some discrete values.
• E.g., domain for Grade Point Average (GPA)
can be from 0 to 4.
• Association of a domain with an attribute
ensures the integrity of database.

3
Components of ER Model
Types of Attributes
1. Simple Attribute
• An attribute that cannot be divided into
smaller component is called simple
attribute.
• It is also called atomic attribute.
• E.g., person can have only one gender and
one date of birth.

4
Components of ER Model
Types of Attributes
2. Composite Attribute
• An attribute that can be divided into smaller
component is called composite attribute.
• Example, Address

5
Components of ER Model
Types of Attributes

3. Single-Valued Attribute

• An attribute that may contain single value is

called single-valued attribute.

• Example, Age of a person.

6
Components of ER Model
Types of Attributes

4. Multi-Valued Attribute
• An attribute that may contain two or more
values is called multi-valued attribute.
• It is represented by double-line oval.
• Example, A person can have two or more
college degrees.

7
Components of ER Model
Types of Attributes

4. Multi-Valued Attribute

8
Components of ER Model
Types of Attributes
5. Stored Attribute
• An attribute that is stored in a database is
called stored attribute.
• Most of the attributes are stored attributes.
• These are stored and access from database.
Example

Date_Employed attribute used in EMPLOYEE


entity type used to calculate
Years_Employed

9
Components of ER Model
Types of Attributes
6. Derived Attribute
• An attribute that is stored not in a database
but derived from another value is called
derived attribute.
• The other value can be stored in a database
or obtained in some other way.
• Derived attribute is indicated by using an
ellipse with a dashed line.

10
Components of ER Model
Types of Attributes
6. Derived Attribute
Example , Roll No, Name and Date of Birth of a
student can be stored in database. The Age of
a student can be derived from Date of Birth.

11
Components of ER Model
Types of Attributes
6. Derived Attribute

12
Components of ER Model
Types of Attributes
7. Identifiers Attribute
• An attribute that identifies an entity instance
among other instances in entity class is
called identifiers attribute.
Example , EMPLOYEE entity class is identified
by his / her EmployeeID etc. these attributes
are called identifiers.

13
Components of ER Model
Types of Attributes
7. Identifiers Attribute

14
Components of ER Model
Types of Attributes
7. Identifiers Attribute
• Identifier can be unique or non-unique.
• Unique identifier may identify only one entity
instance.
• Non-unique identifier may identify a set of
instances.
• Example, EmpolyeeID is unique identifier
because it identifies a single employee. But
Department is non-unique identifier because
it identifies all employees who work in a
particular department.
15
Components of ER Model
Types of Attributes
7. Identifiers Attribute
Types of Identifiers
Simple Identifier
• Identifier that consists of one attribute is
called simple identifier.
• Example, identifier for STUDENT entity type
is Student_ID.

16
Components of ER Model
Types of Attributes
7. Identifiers Attribute
Types of Identifiers

Composite Identifier

• Identifier that consists of composite


attribute is called simple identifier.
• Example, ORDERID identifier may consist of
OrderNo and Date.

17
Components of ER Model
Types of Attributes
7. Identifiers Attribute
Types of Identifiers

Composite Identifier

• Identifier that consists of composite


attribute is called composite identifier.
• Example, ORDERID identifier may consist of
OrderNo and Date.

18
Components of ER Model
7. Identifiers Attribute
Types of Identifiers
Simple Identifier

19
Components of ER Model
7. Identifiers Attribute
Types of Identifiers
Composite Identifier

20

You might also like