Attributes and Types of Attributes in the ER Model
- Siddharth Sharma
- Apr 14, 2025
- 2 min read
In the Entity-Relationship (ER) Model, attributes 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.

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

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.

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.

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.

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.

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.

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.

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.

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.

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:
Defining the structure of entities and relationships.
Helping uniquely identify entities through key attributes.
Facilitating data retrieval by organizing information logically.
Supporting calculations through derived attributes.




Comments