In Entity Relationship(ER) Model attributes can be classified into the following types.
- Simple and Composite Attribute
- Single Valued and Multi Valued attribute
- Stored and Derived Attributes
- Complex Attribute
Simple and Composite Attribute
Simple attribute consists of a single atomic value. A simple attribute cannot be subdivided. For example the attributes age, sex etc are simple attributes.
A composite attribute is an attribute that can be further subdivided. For example the attribute ADDRESS can be subdivided into street, city, state, and zip code.
Simple Attribute: Attribute that consist of a single atomic value.
Example: Salary, age etc
Composite Attribute : Attribute value not atomic.
Example : Address : ‘House_no:City:State
Name : ‘First Name: Middle Name: Last Name’
Single Valued and Multi Valued attribute
A single valued attribute can have only a single value. For example a person can have only one 'date of birth', 'age' etc. That is a single valued attributes can have only single value. But it can be simple or composite attribute.That is 'date of birth' is a composite attribute , 'age' is a simple attribute. But both are single valued attributes.
Multivalued attributes can have multiple values. For instance a person may have multiple phone numbers,multiple degrees etc.Multivalued attributes are shown by a double line connecting to the entity in the ER diagram.
Single Valued Attribute: Attribute that hold a single value
Multi Valued Attribute: Attribute that hold multiple values.
Example1: A customer can have multiple phone numbers, email id's etc
Example2: A person may have several college degrees
Stored and Derived Attributes
The value for the derived attribute is derived from the stored attribute. For example 'Date of birth' of a person is a stored attribute. The value for the attribute 'AGE' can be derived by subtracting the 'Date of Birth'(DOB) from the current date. Stored attribute supplies a value to the related attribute.
Stored Attribute: An attribute that supplies a value to the related attribute.
Example: Date of Birth
Derived Attribute: An attribute that’s value is derived from a stored attribute.
Example : age, and it’s value is derived from the stored attribute Date of Birth.
A complex attribute that is both composite and multi valued.