What is Attribute in ER Diagram: Definition and Examples
ER diagram, an attribute is a property or characteristic that describes an entity or a relationship. Attributes provide details about entities, such as a person's name or an item's price.How It Works
Think of an ER diagram as a map of things and their connections. Each thing, called an entity, has qualities that describe it. These qualities are called attributes. For example, if the entity is a "Car," attributes might be "color," "model," or "year."
Attributes help us understand and organize data by giving more information about each entity or the relationships between entities. They are usually shown as ovals connected to their entity or relationship in the diagram, making it easy to see what details belong where.
Example
This example shows an entity called Student with attributes that describe it.
Entity: Student Attributes: - StudentID (Primary Key) - Name - Age - Email
When to Use
Use attributes in ER diagrams whenever you need to describe entities or relationships with specific details. For example, in a school database, attributes like "Name" and "Grade" describe students, while "Date" might describe when a student enrolls in a course.
Attributes help in designing databases that store useful and organized information, making it easier to retrieve and manage data later.
Key Points
- Attributes describe properties of entities or relationships.
- They are shown as ovals connected to entities or relationships in ER diagrams.
- Attributes can be simple (single value) or composite (made of multiple parts).
- Some attributes serve as primary keys to uniquely identify entities.