Tuesday 1 September 2020

Entity - Relationship (E - R) Diagram in DBMS

 Entity - Relationship (E - R) Diagram:

The Entity Relationship (E-R) data model is based on a perception of a real world that consists of a collection of basic objects called entities and of relationships among these objects. An entity is a thing or object in the real world that is distinguishable from other objects. For example each person is an entity, and bank accounts can be considered as entities.

 

Entities are described in a database by a set of attributes. For example the attributes account number and balance may describe one particular account in a bank, and therefore some attributes of the account entity set. A relationship is an association among several entities. For example a deposit a relationship associates a customer with each account that he or she has.

 

The set of all entities of the same type and the set of all relationships of the same type are termed as entity set and relationship set respectively. The overall logical structure (schema) of a database can be expressed graphically by an ER diagram which is the built up from the following components:

 

·         Rectangles- it represent entity sets

 

·         Ellipses: it represents attributes

 

·         Diamonds: it represents relationship sets

 

·         Lines: it link attributes to entity sets and entity sets to relationship sets

 

·         Double ellipses: it represents multivalued attributes

 

·         Dashed ellipse:  it denote derived attributes

 

·         Double lines:  it indicate total participation of an entity in a relationship set

 

·         Double rectangles: it represents weak entity set


E-R Diagram example

Fig: E-R diagram example

Consider the entity relationship diagram in the above figure which consists of two entity sets, customer and loan, related through a binary relationship set borrower. The attributes associated with customer are customer-id, customer-name, customer-street, and customer-city. The attributes associated with loan are loan- number, and amount.

 

In fig. attributes of an entity set that are members of the primary key are underlined. The relationship set borrower may be one to one, one to many, many to one, or many to many. To distinguish among these relationship types, we draw either a directed line (->) for an undirected line(---) between the relationship set and entity set in question.


Symbols used in E-R diagram:

E-R Diagram Symbols



No comments:

Post a Comment