top of page

Attributes and Types of Attributes in the ER Model

  • Writer: Siddharth Sharma
    Siddharth Sharma
  • Apr 14, 2025
  • 2 min read

In the Entity-Relationship (ER) Modelattributes are properties or characteristics that describe entities or relationships. They define the data that needs to be stored for each entity and help organize and structure information within a database. Attributes are represented as ovals in ER diagrams, connected to their respective entities or relationships.


What is an Attribute?

An attribute is a property or characteristic of an entity or relationship in the ER model. For example:


  • A "Student" entity may have attributes like Name, Age, Roll Number, and Major.

 


Student Attribute
Student Attribute

  • A "Course" entity may have attributes such as Course Name, Duration, and Credits.


Course Entity
Course Entity

Attributes are analogous to columns in a database table, where each column stores specific information about an entity.

Types of Attributes

Attributes can be classified into various types based on their nature and functionality:

1. Simple Attributes

  • These are atomic attributes that cannot be divided further.

  • Example: Roll Number, Age, Gender.

  • Represented as single ovals in ER diagrams.


 


Simple Attributes
Simple Attributes

2. Composite Attributes

  • These attributes can be subdivided into smaller components.

  • Example: Name can be divided into First Name, Middle Name, and Last Name; Address can be split into Street, City, State, etc.

  • Represented with hierarchical ovals in ER diagrams.


Composite Attributes
Composite Attributes


3. Single-Valued Attributes

  • These attributes hold a single value for each entity instance.

  • Example: Date of Birth (DOB), Registration Number.

  • Represented as single ovals.


Single-Valued Attributes
Single-Valued Attributes


4. Multi-Valued Attributes

  • These attributes can hold multiple values for a single entity instance.

  • Example: Phone Numbers (home phone, mobile phone), Degrees (BSc, MSc).

  • Represented using double ovals in ER diagrams.


Multi-Valued Attributes
Multi-Valued Attributes


5. Derived Attributes

  • These attributes are calculated from other attributes rather than being stored directly.

  • Example: Age can be derived from Date of Birth; Total Salary can be derived from Base Salary + Bonuses.

  • Represented with dashed ovals in ER diagrams.


Derived Attributes
Derived Attributes


6. Stored Attributes

  • These are attributes whose values are stored directly in the database rather than being derived.

  • Example: Date of Birth is a stored attribute used to calculate Age.


Stored Attributes
Stored Attributes


7. Key Attributes

  • Key attributes uniquely identify an entity within an entity set.

  • Example: Roll Number for a Student entity or Employee ID for an Employee entity.

  • Represented with underlined text inside the oval.


Key Attributes
Key Attributes

8. Null Attributes

  • These attributes can have a NULL value when the data is not available or applicable.

  • Example: Net Banking Activation Status for customers who do not use online banking.

 

9. Complex Attributes

  • These are composite attributes that can be further subdivided into smaller components.

  • Example: Address → Street → House Number + Street Name.


Complex Attributes
Complex Attributes


10. Required vs. Optional Attributes

  • Required Attributes must have a value for every entity instance (e.g., Name).

  • Optional Attributes may not have a value for some instances (e.g., Phone Number).


Importance of Attributes in Database Design

Attributes play a critical role in database design by:

  1. Defining the structure of entities and relationships.

  2. Helping uniquely identify entities through key attributes.

  3. Facilitating data retrieval by organizing information logically.

  4. Supporting calculations through derived attributes.


 

 
 
 

Comments


bottom of page