Types of Attributes in DBMS

In this article, we will cover:

  1. The topic of “Types of Attributes in DBMS”
  2. The different types of attributes and their meanings
  3. The concept & importance of attributes in DBMS
  4. Applications of attributes in the real world

We aim to give a thorough review of the DBMS attributes in this article because it is essential for students to understand the many features & characteristics of a database.

Attributes are vital properties or qualities of instances belonging to an entity type. They define what the instances are and help to differentiate them from one another. For example, a student’s ID & name are attributes that define them as a unique entity type.

 

Attributes are shared by all instances of the same entity type, but the values for these attributes can differ b/w instances. For example, while all students have a name, father’s name, and age as attributes, the values for each attribute can differ b/w each student. One student may have the name “Mr.Ben,” while another may have the name “John.”

 

The name of an attribute—which must be particular to that entity type—makes it distinct & identifiable. Two attributes with the same name cannot belong to the same entity type, though they may belong to separate entity types.

Let’s understand what an entity is before moving forward.

What is Entity

Entity = Object in the universe

For example, a car is an entity because it’s an object in the universe, and we can give it a name like “BMW  or Tesla Cybertruck.”

An entity is only a name we assign to an object in our environment. For example, a mobile phone, a laptop, a house, a pen, a car, a person, a book, etc. These are all things that exist.

Definitions

Attributes are like the lifeblood of an entity – they give it identity, and meaning, and help us understand its state.

Definition 1:

Attribute = Person, place, or thing, an attribute that serves to identify (ID) + identification (ID) + qualification (Q) + classification (C) + quantification (Qt) + state expression (SE) of an entity occurrence or relationship

Definition 2:

Attribute = Data object that identifies/describes entities.

Different Types of Attributes in DMBS

Types of attributes in DBMS may include:

types of attributes in dbms

Simple Attributes

Simple Attribute → Attribute / Cannot be divided into sub-attributes.

Sometimes, things in life are just simple & straightforward, and that goes for attributes too. Simple attributes are those that cannot be broken down any further, just like the Roll Number, Class, & Age of a Student. To clarify what I mean, look at the Figure or diagram below.

Composite Attributes

Figure: The Student entity is represented by a rectangle, and it includes the Roll Number, Class, & Age attributes. These attributes cannot be further subdivided into sub-attributes, making them simple attributes of the Student entity.

Composite Attributes

Composite attributes are made up of multiple simple attributes.

Composite Attribute = {Set of simple attributes} + Subdivision

Think of a pizza as a composite attribute made up of many simple attributes, like crust type, sauce type, cheese type, &  toppings.

Composite Attributes

The Address property is a composite attribute presented in a beautiful elliptical shape, just like in the figure above. It can be further subdivided into other more simple attributes, including Street, City, State, Country, Landmark, and more. It is remarkable how attributes may combine to form a single entity.

Single-Valued Attributes

Single-valued attributes are attributes that have only one value for each instance of an entity and cannot store more than one value. These attributes are constant & do not change over time, just like a person’s name.

Single-valued attributes are like your name – you can only have one name, and it stays the same for you all your life.

Similarly, in a database, some attributes can only have one value for each thing they describe.

Single-valued attribute = {A | A consists of only one value}

Single-Valued Attributes

For example, in the Student entity, the attributes Roll_no, Age, DOB, and Gender are single-valued. Each instance of the Student entity has a unique Roll_no, a single DOB that can be used to calculate age, and a fixed Gender. These attributes cannot be further divided into sub-attributes and are considered simple single-valued attributes.

Multi-valued Attributes

Multi-valued attributes have the functionality to store multiple values at a time for an entity instance from a set of possible values.

Simple Form,

Multi-valued attribute = An attribute -> Can store {Multiple Values} at a time from a set of possible values.

Multi-valued Attributes

For instance, consider the Student entity having attributes Roll_no, Age, Mob_no, and Email_id. While Roll_no and Age are single-valued attributes, Mob_no and Email_id are multi-valued attributes since a student can have multiple mobile numbers and email addresses. Using multi-valued attributes, we can store and manage multiple values of a particular attribute for each entity instance.

Imagine you had a toy box with a variety of toys inside. Each toy in the toy box may come in different colors, such as a ball that is available in red, blue, & green or a doll with various outfits. In this case, the toy box entity has a multi-valued attribute called “color,” which can store multiple values (i.e., the different colors) for each toy instance.

Toy Box → {Color1, Color2, Color3, …}

where the curly braces { } indicate Multiple Values (i.e., the different colors of the toys).

Derived Attributes

Derived attributes are values that can be derived from other attributes and are always dependent on other attributes for their value, such as Age derived from the Date of Birth attribute.

Derived Attributes

A derived attribute is a function of one or more other attributes, as we saw earlier with the Age attribute being derived from the DOB attribute.

Derived Attribute = Function (Attribute 1, Attribute 2, Attribute 3, …)

Key Attributes

Key attributes are crucial attributes that serve as the primary key for an entity, allowing us to uniquely identify an entity from a set of entities. These attributes store values that are unique & never repeated, ensuring the uniqueness of an entity in the set.

Simply,

Key Attribute = {Unique and Non-Repeating Value}

 

Let’s say you have a class of students, and each student has a unique student Roll number. The student Roll number is a key attribute because it can uniquely identify each student in the class.

For example:

Student Entity → {Name, Age, Student ID Number}

For example, in the Student entity, the Roll_no attribute is not only a simple and single-valued attribute but also a key attribute, as each student has a unique roll number to identify them. However, Gender & Age are not key attributes since they may have identical values for different students, making them unsuitable for identifying unique entities.

Complex Attributes

Complex attributes are not commonly used in database management systems and are formed by combining multi-valued & composite attributes, resulting in a value with many sub-sections.

Simply,

Complex Attribute = Multi-valued Attribute + Composite Attribute

For Example, in the example provided, the Address_EmPhone attribute, which includes address, email, and phone number, is a complex attribute. The address attribute is composite &  is subdivided into house number, street, city, and state, while the email and phone number attributes are multi-valued.

Summarize Types of attributes in DBMS

  1. Simple Attributes: Attributes that cannot be divided into sub-attributes.
  2. Composite Attributes: Made up of multiple simple attributes that can be further subdivided.
  3. Single-Valued Attributes: Attributes that have only one value for each instance of an entity and cannot store more than one value (Attribute >1).
  4. Multi-valued attribute = An attribute -> Can store {Multiple Values} at a time from a set of possible values.
  5. Derived Attributes: Values that can be derived from other attributes and are always dependent on other attributes for their value. 
  6. Key Attributes: Attributes that serve as the primary key for an entity, allowing us to uniquely identify an entity from a set of entities.
  7. Complex Attributes: Formed by combining multi-valued & composite attributes, resulting in a value with many sub-sections.

FAQs

Date of Birth →  Person Age

where Date of Birth functionally determines the Person’s Age

The values of the attributes on the right-hand side (Person’s Age ) are determined by the attributes on the left-hand side (Date of Birth).

 

A dependent attribute in DBMS is an attribute that is determined by another attribute or a combination of attributes in the same entity or related entities.

 It means that the value of the dependent attribute is not unique &  is derived from other attributes.

Null Attribute  Refer to → Null Value  or Empty Value

Student = { Not Data Found in the Database }

The null attribute in DBMS refers to an attribute that does not have a value for a particular instance or entity. It is a special attribute that denotes the absence of a value or the value is unknown or undefined.

The “Address” attribute, which can be further broken down into simple attributes like Street, City, State, & Country or even a landmark, is an example of a composite attribute. Unlike to simple attributes like Roll Number or Age that cannot be further subdivided, composite attributes are made up of several simple attributes.

Recommended Article:

Problems in Communication 

Leave a Reply

Your email address will not be published. Required fields are marked *