Types of Attributes
The characteristics of an entity are called attributes
Example of Attributes
For example, Name, Address, Class, and Email of a student are his attributes.
Different Types of Attributes are given Below:
Types of Attribute:
- Simple Attribute
- Composite Attribute
- Single-Valued Attribute
- Multi-Valued Attribute
- Stored Attribute
- Derived Attribute
An Attribute that cannot be subdivided into a smaller component is known as a simple attribute. It is also called Atomic Attribute.
Example of Simple Attribute
A person can have only one gender and one date of birth:
An attribute that can be divided into a smaller component is called composite attribute.
Example of Composite Attribute
For example, Address is an example composite attribute. It can be subdivided into Street, City, Country. Similarly, a Phone Number can be subdivided into Area Code and Number
An attribute that may contain single value is called single-valued Attribute.
Example of Single-Valued Attribute:
For Example, Age of a person is single-valued Attribute. Gender is also a single-valued attribute.
An Attribute that may contain two or more values is called a multi-valued attribute.
Example of Multi-Valued Attribute
For Example, a person can have two or more college degrees. Similarly, an employee may have many Skills. A multi-valued attribute is represented by a double-line oval.
An attribute that is stored in a database is called a stored attribute. Most of the attributes are stored attributes. These are stored and accessed from the database.
Example of Stored Attribute
Date of Birth is stored attribute because once we stored Date of Birth on Database we don’t need to change DOB forever.
An attribute that is not stored in the database but derived from another value is called a derived attribute.
The other value can be stored in the database or obtained in some other way.
Example of Derived Attribute
For Example, Roll No, Name and Date of Birth of a student can be stored in a database.
The Age of a student can be derived from Date of Birth. A derived attribute is indicated by using an ellipse with a dashed line.