Prerequisite – Introduction of ER Model
An attribute is a property or characteristic of an entity. An entity may contain any number of attributes. One of the attributes is considered as the primary key. In an Entity-Relation model, attributes are represented in an elliptical shape.
Example: Student has attributes like name, agw, roll number and many more. To uniquely identify the student, we use the primary key as roll number as it is not repeated. Attributes can also be subdivided into another set of attributes.
There are five such types of attributes: Simple, Composite, Single-valued, Multi-valued, and Derived attribute.
These are explained as following below.
- Simple attribute:
An attribute which cannot be further subdivided into components is a simple attribute.
Example: The roll number of a student, the id number of an employee.
- Composite attribute:
An attribute which can be splitted into components is a composite attribute.
Example: The address can be further splitted into house number, street number, city, state, country and pincode, the name can also be splitted into first name middle name and last name.
- Single-valued attribute:
The attribute which takes up only a single value for each entity instance is single-valued attribute.
Example: The age of a student.
- Multi-valued attribute:
The attribute which takes up more than a single value for each entity instance is multi-valued attribute.
Example: Phone number of a student:Landline and mobile.
- Derived attribute:
An attribute that can be derived from other attributes is derived attribute.
Example: Total and average marks of a student.