0% found this document useful (0 votes)
252 views10 pages

Types of Attributes in DBMS

Uploaded by

Chinthani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views10 pages

Types of Attributes in DBMS

Uploaded by

Chinthani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Types of Attributes in DBMS

What are the Attributes in DBMS?

✓ Attributes are the characteristic properties that define all the items belonging to a specific category applied
to every column cell.
✓ The values that are used to describe a specific member or attribute as a column in an entity table.
✓ Suppose we have several students in a class; we can uniquely identify a student by the properties
associated with a student, like a student roll number, name, branch, age, etc. These properties that describe
an entity are attributes for students.

✓ We always represent attributes in DBMS in an elliptical shape.


✓ The student represented in a rectangle shape is our entity object.
✓ Student entity has different attributes: Roll_No, Name, DOB, Phone_No, Age, Address, Country, State,
City, and Street.

Note: To uniquely identify the student entity, we may use the primary key as Roll_No as it is not
repeated.

✓ Phone_No is a multi-valued attribute represented by a co-centric elliptical shape,


Example

Take a look at the following database table "student" when students' information is stored.

student_id student_age student_name student_branch

101 21 Aryan Civil Engineering

102 22 Eshaan Electronics and Communication Engineering

103 24 Divyansh Computer Science Engineering

104 21 Vaibhav Singh Chemical Engineering

Here, to store information about every student, we are storing his name, id, age, and branch of each student in
four columns. The properties of student that are student_id, student_age, student_name, student_name are
the attributes for student.

Types of attributes in DBMS

In DBMS, there are various types of attributes


available:

01. Simple Attributes


02. Composite Attributes
03. Single Valued Attributes
04. Multi-Valued Attributes
05. Derived Attributes
06. Complex Attributes (Rarely used )
07. Key Attributes
08. Stored Attributes
01. Simple/Atomic Attribute

✓ Independent attributes

✓ Cannot be classified further.

✓ Cannot be subdivided into any other component.

✓ These attributes are also known as atomic attributes.

✓ Note: Single valued attributes are enclosed inside single-lined circles.

• Student is an entity represented by a rectangle, and it consists of attributes: Roll_no, class, and Age.

• Note : We cannot further subdivide the Roll_no attribute and the other two attributes into sub-attributes.

They are known as simple attributes of the Student entity.

• Such attributes that cannot be further sub-divided into several attributes are called simple

attributes. Example: attributes like the current class and branch of a student have an absolute value, and

they cannot be further sub-divided into other parts like we

divided full_name into first_name, middle_name, and last_name.


02. Composite Attributes

✓ Value of the attribute can be subdivided into component parts.

Name

In the above example :

• Address is a composite attribute represented by an elliptical shape.

• Address attribute can be further subdivided into many simple attributes like Street, City, State,

Country.

• Student_name can be further divided into sub-parts like first_name, middle_name, and last_name
03. Multi-valued Attribute

✓ Attributes that can have multiple sets of values for a single entity are known as Multi-valued attributes.

✓ They are enclosed inside double bounded ovals in the ER diagram .

✓ Multi-valued attributes have opposite functionality to that of single-valued attributes.

✓ Can store more than one value at a time for a given entity instance from a set of possible values.

✓ Represented by co-centric elliptical shape, and we can also use curly braces { } to represent multi-valued

attributes inside it.

In the above example:

• Attributes like Mob_number, Email_id, are categorized as multi-valued attributes because a single

student in the class can have more than one phone number, email_id, and hobbies.

• Roll_no and Age are simple as well as single-valued attributes.

• Mob_no and Email_id are multi-valued attributes.

Note : Each student in the real world can provide more than one email-id as well as a mobile contact number, and
therefore, we need these attributes to be multi-valued so that they can store multiple values at a time for an entity
instance.
04. Derived Attributes

✓ Such attributes whose value can be derived from other attributes of the entity are called derived attributes

in DBMS.

✓ They are always dependent upon other attributes for their value.

✓ Note: Derived attributes are marked using dotted boundaries

In the above example :

• DOB is a single-valued attribute and remains constant for an entity instance.

• From DOB, we can derive the Age attribute, which changes every year, and can easily calculate the

age of a person from his/her date of birth value.

• Hence, the Age attribute here is derived attribute from the DOB single-valued attribute.

Age is the derived attribute.


DOB is the stored attribute.

.
05. Complex Attribute

✓ Complex attributes are rarely used in DBMS.

✓ They are formed by the combination of multi-valued and composite attributes.

✓ These attributes always have many sub-sections in their values.

Example : A person owns more than one house, and each house has more than one phone number. Then,

the attribute phone is represented as a complex attribute.

In the above example :

• Address_EmPhone (which represents Address, Email, and Phone number altogether) is a complex

attribute.

• Email and Phone number are multi-valued attributes while Address is a composite attribute which is

further subdivided as House number, Street, City & State.

• This combination of multi-valued and composite attributes altogether forms a complex attribute.
06. Stored Attributes

✓ An attribute whose values can be calculated from related stored attribute values.

✓ Values of stored attributes remain constant and fixed for an entity instance and also, and they help in

deriving the derived attributes.

Example : The Age attribute can be derived from the Date of Birth attribute, and also, the Date of

birth attribute has a fixed and constant value throughout the life of an entity. Hence, the Date of

Birth attribute is a stored attribute.

• As we can see in the above image, there are different types of attributes in DBMS, well slotted for each
field for an entity instance.
07. Key Attributes

✓ Key attributes are special types of attributes that act as the primary key for an entity and they can uniquely

identify an entity from an entity set.

✓ The values that key attributes store must be unique and non-repeating.

In the above example :

• The Roll_no attribute of the Student entity is not only simple and single-valued attribute but also, a key

valued attribute as well.

• Roll_no of a student will always be unique to identify the student.

• Also note that the Gender and Age of two or more persons can be same and overlapping in nature and

obviously, we can't identify a student on the basis of them. Hence, gender and age are not key-valued

attributes.
Conclusion

• Attributes in DBMS help us to study the characteristics and properties of an entity instance, and we can
also study the relations within the system. Attributes in DBMS are represented by elliptical shapes.
• An entity may contain any number of attributes while one of the attributes is considered to be a primary
key attribute.
• There are different types of attributes in DBMS: Simple, Composite, Single Valued, Multi-Valued,
Stored, Derived, Key, and Complex attributes.
• Simple attributes can't be further subdivided into any other component, and hence, they are also known
as atomic attributes.
• Composite attributes can be further subdivided and hence, are composed of many other simple attributes.
• Single valued attributes consist of a single value for each entity instance and can’t store more than one
value.
• Multi-valued attributes can take up and store more than one value at a time for an entity instance from a
set of possible values. They are represented by a co-centric elliptical shape.
• Derived attributes are those attributes whose values can be derived from the values of other attributes.
• Key attributes act as the primary key for an entity, and they can uniquely identify an entity from an entity
set.
• Complex attributes are formed by the combination of multi-valued and composite attributes.
• Values of stored attributes remain constant and fixed for an entity instance.

You might also like