Type of attributes

Comprehensive study notes, diagrams, and exam preparation for Type of attributes.

Type of Attributes

Definition

An attribute is a data item or property that describes an entity or relationship in a database, and the type of attribute refers to the category that shows how that attribute behaves, stores values, and is represented in the ER model.


Main Content

1. Simple, Composite, and Complex Attributes

Simple attribute

  • : A simple attribute is indivisible and cannot be broken down into smaller meaningful parts. It contains only one value for each entity instance.
    Example: Age, Gender, Salary, Roll Number.
    In the ER model, these are shown as a single oval.

Composite attribute

  • : A composite attribute can be divided into smaller sub-parts, each of which has its own meaning.
    Example: Name can be divided into First Name, Middle Name, and Last Name; Address can be divided into Street, City, State, and PIN Code.
    Composite attributes are useful when data needs to be stored or processed in parts.

Complex attribute

  • : A complex attribute is a combination of composite and multivalued characteristics. It may contain sub-parts and multiple values.
    Example: A person may have multiple addresses, and each address may have street, city, and zip code components.
    This type is useful in advanced data modeling when one attribute cannot be represented by a single simple structure.

Example structure:

Employee
   |
   +-- Name
   |     +-- First Name
   |     +-- Last Name
   |
   +-- Address
         +-- Street
         +-- City
         +-- ZIP

2. Single-Valued and Multivalued Attributes

Single-valued attribute

  • : A single-valued attribute holds only one value for each entity instance.
    Example: Date of Birth, Blood Group, Employee ID.
    For one student, there is usually only one roll number and one date of birth.

Multivalued attribute

  • : A multivalued attribute can have more than one value for a single entity instance.
    Example: Phone Numbers, Email Addresses, Skills, Degrees.
    A person can have multiple phone numbers or multiple skills.

Representation in ER diagrams

  • : A single-valued attribute is represented by one oval, while a multivalued attribute is usually shown using a double oval.
    This visual distinction helps database designers quickly identify attributes that may require separate tables in relational databases.

Example:
A student may have the following multivalued attribute:

  • Skills = {Java, Python, SQL}
  • Phone Numbers = {9876543210, 9123456780}

Important note:
In relational database design, multivalued attributes are often stored in a separate table to avoid repeating groups and to maintain normalization.


3. Derived, Stored, Key, and Null Attributes

Derived attribute

  • : A derived attribute is not directly stored in the database; instead, it is calculated from other stored attributes.
    Example: Age can be derived from Date of Birth. Total Marks can be derived from subject marks.
    Derived attributes reduce redundancy because the value can be computed whenever needed.

Stored attribute

  • : A stored attribute is physically saved in the database and used to derive other attributes if needed.
    Example: Date of Birth is stored, and Age is derived from it.
    Stored attributes are the actual source values in the database.

Key attribute

  • : A key attribute uniquely identifies an entity instance. It helps distinguish one record from another.
    Example: Student ID, Employee Number, Roll Number, Aadhaar Number.
    A key attribute is essential for maintaining uniqueness and data integrity.

Null attribute

  • : A null attribute is an attribute whose value may be unknown, missing, or not applicable.
    Example: A student without a middle name, or an employee who has not yet been assigned a phone number.
    Null values must be handled carefully because they may affect queries, calculations, and database consistency.

Small comparison table:

Attribute Type Meaning Example
Stored Saved directly in database Date of Birth
Derived Calculated from stored values Age
Key Uniquely identifies entity Student ID
Null Missing or not applicable Optional Middle Name

Working / Process

1. Identify the entity or relationship

First, determine what object or concept is being described, such as Student, Employee, Course, or Department.

2. List all properties

Write down all characteristics of that entity, such as name, address, age, phone number, and ID.

3. Classify each attribute type

Decide whether each attribute is simple, composite, multivalued, derived, key, stored, or null.
This classification helps create a correct ER diagram and supports proper database normalization.


Advantages / Applications

  • Helps in designing accurate ER diagrams and database schemas
  • Reduces data redundancy by identifying derived and composite attributes correctly
  • Improves database efficiency and consistency by separating multivalued attributes where necessary
  • Supports better query processing and data organization
  • Useful in real-world systems such as student management, banking, hospital records, payroll systems, and e-commerce databases

Summary

  • Attributes are properties used to describe entities or relationships.
  • Different types include simple, composite, multivalued, derived, stored, key, and null attributes.
  • Correct classification of attributes is important for good database design.
  • Important terms to remember: attribute, entity, composite attribute, multivalued attribute, derived attribute, key attribute