An Attribute is a property or characteristic that describes an entity in a database. It provides specific information used to identify, categorize, and manage entities effectively. Without attributes, entities have no meaningful data.
For example:
- Let's take the student as an entity. Students will have multiple attributes such as roll number, name, and class.
- These attributes are used to describe the student in more detail.

- As shown in the figure, roll_no, name, and class are the attributes of the entity Student.
- All three attributes give meaning to the entity. The information about the student entity lies in all 3 attributes.
Types Of Attribute
There are 8 types of Attributes in DBMS.
1. Simple Attribute
Simple Attributes are indivisible properties that hold basic information about an entity, such as name, roll number, or age. They cannot be broken down further and are often used to build other types of attributes.
Let's understand this with the help of example:
- Here in the below example, Student has roll_no, class, and name as attributes that cannot be divided into more sub-attributes.
- These types of attributes are called simple attributes.
- Simple attributes are mainly used to create all other types of attributes.

2. Composite Attribute
A composite attribute is formed by combining two or more simple attributes. It is used to represent complex data structures, like a full name made of first and last names.
Let's understand this with the help of example:
- Here if we look at the below example, address is the attribute derived from the 3 simple attributes i.e. City, State, and Street.
- To get the value of the address attribute, we have first to know those city, state, and street attributes.
- This type of attribute is known as a composite attribute.

3. Single Valued Attribute
A single-valued attribute contains only one value per entity instance. Mostly these attributes are used to provide the unique identity to the multiple instances of attributes.
Let's understand this with the help of Example:
- In the given example, we know that the DOB attribute will have only one value. So we can say that the DOB attribute is nothing but a single-valued attribute and it cannot have multiple attributes.
- Here roll_no and name will also have mostly one value only.
- We can say that all 3 attributes of the student are single-valued.

4. Multivalued Attribute
A multivalued attribute can have multiple values for one entity instance. Unlike single-valued attributes, it stores several values linked to the entity.
Let's Understand this with the help of Example:
- In the given example, Student has an attribute named phone_no. One student can have multiple phone_no, so we can say that phone_no can have multiple values.
- These types of attributes are known as multi-valued attributes.
- Multi-valued attributes are used when more than 1 entries for one attribute need to be stored in the Database.

5.Key Attribute
A key attribute has a unique value for every entity and is used to identify it. It plays an important role in ensuring data is distinct in a database.
Let's Understand this with the help of Example:
- For students, we can identify every student with roll_no because each student will have a unique roll_no.
- This indicates that roll_no will be a Key attribute for the Student entity.
- All operations on the database can be performed only using Key Attributes.

6. Derived Attribute
A derived attribute is an attribute calculated from other attributes in the database and is not physically stored. Its value is obtained using existing data within the same database.
Let's understand this with help of Example:
- Here the student has multiple attributes including DOB and age. It is observed that age can be calculated with the help of the DOB attribute.
- So age is a derived attribute that is derived from an attribute named DOB.

7. Stored Attribute
Stored attributes are physically stored in the database (unlike derived attributes). They can change (e.g., a student’s address), but they are stored directly, not calculated.. It stores permanent information that remains fixed throughout the entity’s lifetime.
Let's understand this with the help of example
- The student has 3 attributes as shown above. Her name and DOB will remain the same throughout his/her education. So the student has a fixed value attribute that will never change in the future.
- These attributes are known as stored attributes.

8.Complex Attribute
A complex attribute is a combination of composite and multivalued attributes. It can contain multiple levels of sub-attributes. Complex attributes can have an unlimited number of sub-attributes.
Let's understand this with the help of Example:
- Here for the student, we created an attribute named contact_info which further decomposed into phone_no + Address.
- The address is a composite attribute which is further divided into simple attributes and phone_no is a multivalued attribute.
- This indicates that the contact_info attribute is made from the multi-valued and composite attribute.
- This type of attribute is known as the Complex Attribute.
