Vous êtes sur la page 1sur 19

E-R Modeling

Topics
Explain the concept and practical use of data modeling. The E-R Model Entity Relationship Model Constructs Relationships in entity relationship Model

Core Of Data Modelling Exploring the different ways that entities can relate to each other as they always do in the real world Devising a way of recording, of diagramming, the entities and the ways in which they interrelate in the business environment

Entity Relationship(E-R) Model A diagramming technique Visual Representation of the Structure Diagrams entities (with attributes) and the relationship between the entities. Logical Representation of data for an organization or for a business area E-R diagram is a graphical representation of ER Model

Entity Relationship(E-R) Model Constructs Entity : is a person, place object , event or concept in user environment For e.g. Person : Employee , student, patient Place : Store , Warehouse , State. Object : machine , Building , Automobile

Entity Relationship(E-R) Model Constructs

Entities are represented in Rectangular shape Student = a type of entity


Students

Entity Relationship(E-R) Model Constructs Strong V/s Weak Entity Types Strong Entity
An entity that has a primary key An Entity that exists independently of other entity types. For e.g. Student , Employee.

Weak Entity
An entity that does not have sufficient attributes to form a primary key An Entity whose existence depends on some other entity type.

Entity Relationship(E-R) Model Constructs Attribute : is characteristics or property of an Entity.


STUDENT(StudentId, Name, Address) StudentId , name and address are attributes of Entity Student.

In diagrams, entity set attribute oval.

rectangle;
ID name
Students

phone

height

Entity Relationship(E-R) Model Constructs

Simple v/s Composite Attributes


Simple Attribute : Cannot be broken into smaller components For e.g. Color , Weight Composite Attribute : Can be broken into smaller components. For e.g. Address can be broken into city , state , postcode , street address etc.

Entity Relationship(E-R) Model Constructs


Single-valued v/s Multiple valued Attributes

Single Valued : Attributes which can have only one value. MultiValued : Can have more than one value for a given entity instance.

Entity Relationship(E-R) Model Constructs


Stored v/s derived Atributes Stored Attributes : Attributes which are already stored in the database. Derived Attributes : is an Attribute whose value can be calculated from related attribute values. For e.g. Number of years employed can be calculated from Date_employed attribute of employee.

Relationships Associations between entities Different Kind of relationships


Unary Relationships Binary Relationships Ternary Relationships
N-ary

Relationships Unary Relationship : A relationship between instance of a single entity type. Binary Relationship : A relationship Between instances of two entity sets.
Simplest Kind Of relationship Diamond shaped box represent relationship
A salesperson sells products or products are sold by salesperson.
Salesperson Sells Products

Relationships
Ternary Relationship :

Professor

recommends

Reference boook

Course

Cardinality
Represents the maximum number of entities that can be involved in a particular relationship.
One-to-One Relationship One-to-Many Relationship Many-to-Many Relationship

One to One Binary relationship


1-1
A single occurrence of one entity type can be associated with a single occurrence of the other entity type and vice versa.

One to Many Binary relationship 1-M Use Crows foot to represent the multiple association many = the maximum number of occurrences that can be involved, means a number that can be 1, 2, 3, ... n.

Many to Many Binary relationship M-M Many can either be a exact number or have a known maximum. many = the maximum number of occurrences that can be involved, means a number that can be 1, 2, 3, ... n.

Relationships

Vous aimerez peut-être aussi