What is Composite Attribute in DBMS?
A database component, such as a field or table, is an attribute. It is of many types like simple, single-valued, multi-valued, composite, complex, and many more. The attribute which cannot divide into more parts is known as simple attributes. The attributes that divide themselves into more sub-parts are known as composite attributes. Composite attribute divides itself into multiple simple attributes. Let us learn about composite attributes in DBMS more through this article.
Student Roll Number, Employee id, Account balance, Salary, Account number, and Aadhar number are an example of simple attributes as they cannot get further divided into sub-parts. Name and address are an example of complex attributes as they get further divided into sub-parts. Name can divide into sub-parts First name, Middle name, and Last name. An address can divide into house number, street, locality, city, state, and pin code.
Representation of Composite Attribute
We represent a composite attribute in DBMS using an oval shape attached to oval shapes that represent simple attributes.
Methods for Mapping
The relation names get represented by an entity set of ER diagrams. The attribute of an ER Diagram represents the name of a column.
Let us see an example of mapping an ER Diagram with a composite attribute.
We will draw the ER Diagram for the following relation:
In the above relation, we can see that the attribute CustomerID and Name are simple attributes. The address is a composite attribute whose components are street, city, state, and pin code.
- Composite attributes in DBMS are those attributes that can further divide into more simple attributes.
- Student Roll Number, Employee id, Account balance, Salary, Account number, and Aadhar number are an example of simple attributes.
- Name and Address are an example of complex attributes.
- Name can be divided into simple attributes like first, middle, and last name.
- Composite attribute in DBMS is represented by an oval shape attached to more oval shapes denoting simple attributes.
- The names of the relation get represented by an entity set, and the name of the column gets represented by the attribute in an ER Diagram.