Friday, October 12, 2012

Entity – Relationship model (ER model) Overview

Entity – Relationship model (ER model) :

        Entity and Relationship Model was developed by a US scientist Mr. Chen in 1976.In software engineering, an Entity – Relationship model (ER model) is an abstract way to describe a database. It usually starts with a relational database, which stores data in tables. Some of the data in these tables point to data in other tables - for instance, your entry in the database could point to several entries for each of the phone numbers that are yours. The ER model would say that you are an entity, and each phone number is an entity, and the relationship between you and the phone numbers is 'has a phone number'. Diagrams created to design these entities and relationships are called entity–relationship diagrams or ER diagrams.

ER-Diagrams :
             When user need to design ER-Diagrams then he use the following symbols.

Entity :
            An entity may be defined as a thing which is recognized as being capable of an independent existence and which can be uniquely identified. An entity is an abstraction from the complexities of a domain. When we speak of an entity, we normally speak of some aspect of the real world which can be distinguished from other aspects of the real world.
          An entity may be a physical object such as a house or a car, an event such as a house sale or a car service, or a concept such as a customer transaction or order. Although the term entity is the one most commonly used, following Chen we should really distinguish between an entity and an entity-type. An entity-type is a category. An entity, strictly speaking, is an instance of a given entity-type. There are usually many instances of an entity-type. Because the term entity-type is somewhat cumbersome, most people tend to use the term entity as a synonym for this term. Entities can be thought of as nouns.

Examples :  a computer, an employee, a song, a mathematical theorem.

Relationship :
         A relationship captures how entities are related to one another. Relationships can be thought of as verbs, linking two or more nouns.

Examples :

1) An owns relationship between a company and a computer
2) A supervises relationship between an employee and a department
3)A performs relationship between an artist and a song
4)A proved relationship between a mathematician and a theorem.
Attribute :
         Entities and relationships can both have attributes.

Examples :
An employee entity might have a Social Security Number (SSN) attribute; the proved relationship may have a date attribute.

           Every entity (unless it is a weak entity) must have a minimal set of uniquely identifying attributes, which is called the entity's primary key. Entity–relationship diagrams don't show single entities or single instances of relations. Rather, they show entity sets and relationship sets. Example: a particular song is an entity. The collection of all songs in a database is an entity set. The eaten relationship between a child and her lunch is a single relationship. The set of all such child-lunch relationships in a database is a relationship set. In other words, a relationship set corresponds to a relation in mathematics, while a relationship corresponds to a member of the relation.

ER-Diagram Example :
         The following diagram represents the relationship between sales representative and the customer and how the relationship is maintained between the entities.

No comments:

Post a Comment

back to top