Types of Attributes in DBMS
Overview
In this tutorial, we will learn about different types of attributes. An attribute describes the property of an entity. An attribute is represented as an Oval shape in an ER diagram.
Types of Attributes
The different types of attributes are as follows:
- Key attribute
- Composite attribute
- Multivalued attribute
- Derived attribute
Key attribute
A key attribute can uniquely identify an entity from an entity set. For example, an employee ID can uniquely identify an employee from a set of employees. An oval symbol with underlined text represents the key attribute.
Emp-ID is the primary key attribute of the Employee entity.
Composite attribute
A composite attribute is a combination of other attributes. For example, in a student entity, the student address is a composite attribute, as it is composed of other attributes such as state, country, and pin code.
Multivalued attribute
An attribute that can hold multiple values is known as a multivalued attribute. Double ovals represent multivalued attributes in an ER diagram. For example, a person can have more than one phone, so the ‘Phones’ attribute is multivalued.
Derived attribute
A derived attribute is one whose value is dynamic and derived from another attribute. A dashed oval in an ER Diagram represents a derived attribute. For example, Age is a derived attribute that changes over time and can be derived from another attribute. (for example, using the date of birth).