[ppt]powerpoint presentationbcasbapatla.ac.in/material/entity relationship model.pptx · web...

15
Entity- Relationship Data Model N. Harika Lecturer(csc)

Upload: duongkhanh

Post on 23-May-2018

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Entity-Relationship Data Model

N. HarikaLecturer(csc)

Page 2: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Presentation Overview• Short historical overview• Elements of E-R Model• Basic organization & relationships in E-R Model• Design principles

Page 3: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

HISTORY OF E-R MODEL

• E-R Model was proposed by Dr. Peter Chen (currently professor at Louisiana State University)

• Chen’s original paper on E-R Model is the 35th most sited paper in computer science

• Chen has written papers interconnecting E-R model and linguistics

Page 4: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Introduction Database Structure is often called

Database Schema E-R model is graphical in nature, thus

making it easy to analyze and observe relationship between data elements

Most DBMS are based upon E-R model E-R model is not a good match for the

sophisticated data structures required in today’s DBMS

Page 5: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Elements of E-R ModelData represented graphically via entity-

relationship diagram which contains 3 main element types:Entity setsAttributesRelationships

Page 6: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Entity set Is an abstract object, collection of such

objects forms an entity set. Similar notion as in OO design

Attribute: Some concrete data (or object type) by

which entity set is defined Relationship

Specific connection between 2 or more entity sets

Entity sets, Attributes, Relationships

Page 7: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

E-R Diagram• Represents E-R elements by nodes of specific shape

to indicate kindo Entity sets are represented by rectangleso Attributes are shown as ovalso Relationships correspond to diamonds

• Simple example from the book:

Page 8: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Simple illustration

Page 9: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

INSTANCES OF E-R DIAGRAM DB described by E-R will contain specific

data (i.e. database instance) Each entity set will contain a particular

finite set of entities Each entity contains a particular value

for each attribute E-R data is not stored directly in DB

Page 10: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

E-R Relationships

Suppose R is a relationship connecting entity sets E and F. Then: If each member of E can be connected by

R to at most one member of F, then we say that R is many-one from E to F. Note that in a many-one relationship from E to F, each entity in F can be connected to many members of E.

If R is both many-one from E to F and many-one from F to E, then we say that R is one-one. In a one-one relationship an entity of either entity set can be connected to at most one entity of the other set.

If R is neither many-one from E to F or from F to E, then we say R is many-many

Page 11: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

MULTI-WAY RELATIONSHIPS

There is a relationship Sequel-of between the entity set Movies and itself.

To differentiate the two movies in a relationship, one line is labeled by the role Original and one by the role Sequel, indicating the original movie and its sequel, respectively.

Page 12: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

RELATIONSHIPS CONTINUED Some data models limit relationships to be binary It is possible to convert multi-way relationship into a collection

of binary many-one relationships Need to introduce a connecting entity set, which will act as a

bridge between smaller sets which come from splitting a larger multi-way relationship set.

Connecting entity set might have its own attributes

Page 13: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

DESIGN PRINCIPLES

• Faithfulness:• Design has to comply strictly with specifications• Logical attributes and relationships

• Avoid redundancy• "Everything should be made as simple as possible, but not

simpler.” Albert Einstein• Choose right relationships• Select right elements• Many choices exist between using attributes and using entity

set/relationship combinations• An attribute is simpler to implement than either entity set or a

relationship

Page 14: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram

Design Principals Cont.• To replace an entity set by an attribute or attributes

of several entity sets 3 conditions must be enforced:o All relationships in which entity set is involved must have arrows entering

it. That is, it must be the “one” in many-one relationships, or its generalization for the case of multi-way relationships.

o The attributes for E must collectively identify an entity. if there are several attributes, then no attribute must depend on the other attributes

o No relationship involves E more than once

Page 15: [PPT]PowerPoint Presentationbcasbapatla.ac.in/material/Entity Relationship model.pptx · Web viewElements of E-R Model Data represented graphically via entity-relationship diagram