COM 117 Introduction to Application Building Week 2 Entity Relation Diagrams - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

COM 117 Introduction to Application Building Week 2 Entity Relation Diagrams

Description:

A 'crows foot' identifies which is the detail (many) entity ... Relationship lines must not cross. Avoid 'dead crows'! Stage 1. Stage 2. Stage 3 ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 20
Provided by: CET
Category:

less

Transcript and Presenter's Notes

Title: COM 117 Introduction to Application Building Week 2 Entity Relation Diagrams


1
COM 117 Introduction to Application BuildingWeek
2 Entity Relation Diagrams
  • Lecture outcomes
  • Be able to describe entities
  • Be able to establish the relationship between
    entities
  • Be able to model and construct ERDs
  • Be able to apply the general rules for an E-R
    model

2
Week 2 Entity Relation Diagrams
  • Also called Logical Data Structures (LDS)
  • A top-down approach
  • Start by asking
  • Who or what do we need to store data about?
  • Results in a useful first attempt but
  • may be incomplete model
  • may have redundant data
  • relationships may be vague

3
Terminology
  • entities
  • an entity is an object about which the system
    requires to hold data
  • e.g. CUSTOMER
  • occurrences of entities
  • an occurrence describes a particular instance of
    an entity
  • e.g. a customer called Mrs Partridge!

4
Entities
  • values of entities
  • is the value of that attribute for a particular
    entity occurrence
  • entity keys
  • an attribute or set of attributes that UNIQUELY
    identify an occurrence of an entity
  • (Primary key in an Access table!)

5
Relationships between entities
  • this is a link between two entities that is
    significant for the system
  • VERY IMPORTANT to capture ALL significant
    relationships

6
The Degree of Relationships
  • one to one
  • A husband has one wife (at a time normally!) and
    vice versa
  • one to many
  • A GP has many patients but the rules of the
    practice dictate that a patient is registered
    with only one doctor
  • many to many
  • A musician plays in many concerts and a concert
    is performed by many musicians

7
Notation
8
(No Transcript)
9
Entity Relationship Diagrams
  • Further Reading
  • Britton Doake
  • Software System Documentation, A Gentle
    Introduction
  • Pages 59-65

10
E-R Models - Practical Guidelines
  • A data model should exhibit the following
    characteristics
  • data grouped logically
  • each group should have a primary key
  • no redundant data

11
No redundant data
  • data never used by system
  • a data item stored in more than one place
  • data in one place can be derived from data held
    elsewhere

12
To summarise
  • put data items in logical groups that go together
  • ensure that a data item needs to be stored, i.e.
    cannot be derived
  • ensure that each data item is stored only once
  • ensure that there is enough information to
    identify a particular instance of a data group

13
How to Build an E-R Model
  • Look at system and identify data objects
    (entities)
  • For each entity, list its attributes
  • For each entity, check the attributes for
    completeness
  • Investigate and record relationships
  • Check entity descriptions against data dictionary
    descriptions of data stores, inputs, outputs,
    data flows etc.

14
In short -
  • Establish every entity and possible
    relationship
  • Rationalise many-to-many relationships
  • Delete duplicated
  • relationships

15
General Rules for an E-R Model
  • Each entity is represented by a box
  • A line connecting boxes represents an entity
    relationship
  • A crows foot identifies which is the detail
    (many) entity
  • Each occurrence of a master can own several
    occurrences of detail
  • For any given relationship, a detail may only
    have one master
  • A master may exist without details

16
More rules
  • Unless information is lost by removing them,
    entities should not be connected by more than one
    relationship route
  • Relationship lines must not cross
  • Avoid dead crows!

17
Stage 1
18
Stage 2
19
Stage 3
Write a Comment
User Comments (0)
About PowerShow.com