×

Components of an ER Diagram

An ER Diagram consists of the following components:

  1. Entity
  2. Attributes
  3. Relationships
Components of an ER Diagram

1. Entity

An entity may be an object, place, person, or an event which stores data in the database. In an entity-relationship diagram, an entity is represented by a rectangle. Student, course, manager, employee, patient, etc. are examples of an entity.

Components of an ER Diagram

Entity type: An entity type is a collection or a set of entities having some common attributes. In a database, each entity type is described by a name and list of attributes.

Components of an ER Diagram

Entity set: It is a set (or collection) of entities of the same type which share the similar properties, or attributes.

For example,the group of people who are lecturers in a university can be de?ned as an entity set lecturer. Similarly, the entity set of students might represent the group of all students in the university.

Components of an ER Diagram

An entity can be characterized into two types:

  1. Strong entity: This type of entity has a primary key attribute which uniquely identifies each record in a table. In the ER diagram, a strong entity is usually represented by a single rectangle.
  2. Weak entity:An entity does not have a primary key attribute and depends on another strong entity via foreign key attribute. In the ER diagram, a weak entity is usually represented by a double rectangle.

2. Attributes: An attribute in an Entity-Relationship Model describes the properties or characteristics of an entity. It is represented by an oval or ellipse shape in the ER diagram. Every oval shape represents one attribute and is directly connected to its entity which is in the rectangle in shape.

For example, employee_id, employe_name, Gender, employee_age, Salary, and Mobile no. are the attributes which define entity type Employee.

Components of an ER Diagram

In the ER model, an attribute can be characterized into the following types:

  1. Simple attribute: An attribute which contains an atomic value and cannot be divided further is called a simple attribute.For example, Gender and Salary of a person. It is also represented by an oval.
Components of an ER Diagram
  • Key attribute: An attribute which can uniquely identify an entity in an entity set is called a key attribute. It represents a primary key in the ER diagram. In an Entity-Relationship diagram, the key attribute is denoted by an oval with an underlying line. For example, employee_id will be unique for each employee.
Components of an ER Diagram
  • Composite attribute:An attribute which is a combination of two or more simple attributes is called a composite attribute. In an Entity-Relationship diagram, it is represented by an ellipse, and that ellipse comprises of other ellipses.For example, the Name attribute of an employee entity type consists of First name, Second name, and Last name.
Components of an ER Diagram
  • Derived attribute: An attribute which can be derived from other attributes is called a derived attribute. In an entity-relationship diagram, these attributes are represented by a dashed oval shape. For example, employee_age is a derived attribute as it changes over time and can be derived from another attribute DOB (Date of birth).
Components of an ER Diagram
  • Multi-valued attribute: An attribute which contains more than one value for a given entity. For example, an employee can have more than one mobile number and email address.
Components of an ER Diagram

3. Relationship

A relationship in Entity-Relationship Model is used to describe the relation between two or more entities. It is represented by a diamond shape in the ER diagram. For example, student study in college, employee works in a department. Here, ‘study in’ and ‘works in’ are the relationships.

Degree of Relationship

A relationship where a number of different entity set participate is called as degree of a relationship.

Degree of relationship can be categorized into the following types:

  1. Unary Relationship
  2. Binary Relationship
  3. Ternary Relationship
  4. n-ary Relationship
  1. Unary Relationship: A relationship where a single entity set participates is called as a unary relationship. For example, In a company, an employee manages or supervises another employee.
Components of an ER Diagram
  • Binary Relationship: When two entity set participates in a relationship is called a binary relationship.

It is further categorized into four types:

  1. One-to-One Relationship: When one entity from an entity set A is associated with another entity of entity set B and vice versa. Such type of relationship is called one to one relationship.
Components of an ER Diagram
Components of an ER Diagram
  1. One-to-Many Relationship:When one entity from an entity set A is associated or linked with multiple entities of entity set B, then it is called a one-to-many relationship.
Components of an ER Diagram
  1. Many-to-One Relationship: When more than one entities from an entity set A is associated with one entity of entity set B, then it is called a many-to-one relationship.
Components of an ER Diagram
  1. Many-to-Many Relationship: When more than one entity from an entity set A is associated with many entity of an entity set B. Such types of relationship are called a many-to-many relationship.
Components of an ER Diagram

c) Ternary Relationship: When three entity set participates in a relationship, is called a ternary relationship.

Components of an ER Diagram

d) n-ary Relationship: When more than three entity set involves in a relationship is called an n-ary relationship.


Related Topics

DBMS Schema

Schema It is a physical representation of data that appears in the database management system. In simple words, a schema is the structure of any database.It defines how the data is stored...

2 minutes read.

BCNF in DBMS

BCNF stands for Boyce–Codd Normal Form. What is the Normal form? The normal form is mainly used to reduce the redundancy of the database tables. Or we can say that the normal form...

4 minutes read.

3- Tier Architecture in DBMS

Three-tier architecture is an application software architecture that arranges the output into three parts or tiers that are:  the presentation tier, where the user interacts with the application; the application...

4 minutes read.

B+ (Plus) Tree in DBMS

What is a B+ tree? The B+ tree is known as a balanced binary search tree. in this tree, we can store the data in the form of nodes. B+ tree...

9 minutes read.

Advantages of B-Tree in DBMS

A self-balancing search tree is the B-Tree. It is assumed that everything is in the main memory in most other self-balancing search trees (such as AVL and Red-Black Trees). We must...

3 minutes read.

Domain Constraints in DBMS

Introduction about DBMS:- DBMS stands for DataBase Management System. DBMS(DataBase Management System) is a type of software by which we can save and retrieve the user's data with the security process....

3 minutes read.

Foreign key in DBMS

Foreign key in DBMS: The Foreign key is a field or the set of fields in the relational database table, which points to the existing field in another table. It...

2 minutes read.

B-Tree Insertion in DBMS

A B-tree is a special type of m-way tree, commonly used for disk access. A B-tree of order m can have at most m-1 keys and m descendants. B-trees are...

4 minutes read.

Meta Data in DBMS

Metadata: Metadata is simply described as information about information. It indicates that the data is described as well as its context. It makes data easier to find, interpret, and organize. I'll...

4 minutes read.

Inference Rules

Armstrong’s axioms are the complete set of basic inference rules used to infer all the functional dependencies on the relational database. An inference rule is a type of assertion that a user can...

2 minutes read.

Advantages of RDBMS

The relational database management system collects related data stored in tabular format. The data is stored in rows and columns, where rows usually represent the individual entity of the collected...

6 minutes read.

Aggregate Functions in DBMS

Aggregate Functions in DBMS: Aggregate functions are those functions in the DBMS which takes the values of multiple rows of a single column and then form a single value by...

2 minutes read.

Relational algebra in DBMS

Relational algebra in DBMS Relational algebra is a procedural query language used to retrieve the data from a database in a different way. It works on the relational model. It performs...

3 minutes read.

DBMS View: Read, Update, Create and Drop

View in DBMS: The View is a logical or virtual table that allows users to view or manipulate parts of the table. View is also a table which consists of...

2 minutes read.

Characteristics of DBMS

Introduction to DBMS: A database management system (DBMS) is a software application that is designed to manage and organize data stored in a database. It is responsible for storing, retrieving, and...

3 minutes read.

What is Non-Relational Database

Databases can be sorted as either relational or non-relational. Non-relational data sets are now and again alluded to as "NoSQL," which represents Not Only SQL. The principal difference between these...

4 minutes read.

Secondary Key in DBMS

What are Keys? Keys in DBMS are the attributes or set of attributes that uniquely identify a row in a set of relations. A table (relation) can have a column or...

3 minutes read.

Types of Data Abstraction in DBMS

What Is Data Abstraction? To ship an email, you want to know the address. But to send the email, you don't need to see where the email is physically stored. You...

6 minutes read.

Conflict Serializability in DBMS

Conflict Serializability A schedule is said to be conflict serializable if it can transform into a serial schedule after swapping of non-conflicting operations. It is a type of serializability that can be used...

3 minutes read.

Constraints in Database Management System

In a database management system, certain constraints are applied while performing any operation on the database to ensure that the integrity and quality of the data are maintained throughout the...

4 minutes read.