Pr.Pg Next Pg

The ENTITY / RELATIONSHIP (ER) model tutorials

 

  • Peter chen first introduced the “Entity/Relationship (ER)” model in 1977. ER model is very easy to create and refer. It is used to create a relational model and transform its elements into database element.

  • The ER model is made of 3 different elements.

 

1) Entity :-

  • Peter Chan defines an entity as “a thing that can be distinctly identified”. We can say entity can be information related with some transaction, that presents real work data such as customer, supplier, item details, sales or purchase order, receipts, payments and so on

  • The basic data item stored in a database is called an entity. An entity can be any object, item, person, place, transaction, concept or any activity about which data can be stored.

 

2) Attribute:-

  • An Attribute is a noun or an adjective that identify or describe an entity. An attribute is a property of an entity. It describes a part of entity. An object could have one or more attributes.

  • It is the smallest information available for particular data. It is the attributes that describe the Entity. For e.g. Invoice no, Invoice Date, Party name, salesman no etc.

  • An attribute identifying an entity is called key attribute. An attribute describing an entity is called non-key attribute. For example an Employee ID is key attribute of the Employee Entity whereas Employee First name, last name, second name are non-key attribute.

  • TASK:- Write attributes required to store “Employee” entity

3) Relationship:-

  • It represents relationship between objects, for e.g. the Supplier sell items to us. We get sales order from customers. We receive Cash or cheque from Customers, We makes payment to supplier and so on.

  • Relationships are complex elements. They represent association between entities and bind them with a set of defined rules. Relationships carry 3 other characteristics.

a) Direction indicates the source entity: for instance, a customer places an order. So the relationship goes from customer entity to order entity. The source of relationship is referred as the “Parent” entity and the destination as “Child” entity. So in this example Customer is Parent and Order is child. The relationship always goes from parent to one or many children.

b) Number of instance of specific entity may vary with another entity:- for example an employee can apply for leave. An employee may apply for one leave or may apply of many leave.

c) Existence determines the precedence between entity:- an entity must exist before another entity is created. For example in order to be in leave entity, employee entity must be present, in order to be in sales order entity – customer entity must be present.

 

Pr.Pg border                                              Next Pg