Professional Documents
Culture Documents
System Analysis
Week 4 – Entity Modelling & Entity Relationship
Diagrams
1
Content
• Entity Modelling
• Entity Relationship Diagrams
2
(Structured System Analysis & Design
Methodology - SSADM)
Data Flow Diagrams (DFD)
• DFDs show the processes, or functions, involved in a system.
• They don’t tell us much about the structure of the data.
3
Entity Modelling
• Entity Models
– Real data
– How the data connected?
4
Entities
• things we might want to keep information about
– People like CUSTOMER
– Objects like PRODUCT
5
Is it an «entity»?
1. An entity must be important to the organization.
2. An entity must have at least one attribute
3. An entity must occur more than once
4. Each entity occurrence must be uniquely identifiable
6
Representation form for entitites
• rectangles with rounded corners in Entity Models
• The name of the entity is always singular!!
• RECEIPT
• DRINK
• PATIENT
7
Attribute
Attributes are bits of data associated with the entity
Entity: MEMBER
Attributes:
– Member Name
– Membership Number
– Member Address
– Date of Birth
– Type
– Seconder
– Renewal Date
8
Attribute
• An employee of an organization is an entity.
• If “Peter” is a programmer (an employee) at Microsoft, he can
have attributes (properties) like name, age, weight, height, etc.
9
A full membership record
10
Keys
A key is a way of identifying something
13
Relationships
• The entities are joined together by a verb which describes
the relationship between them.
• In an entity model, related entities are joined by a line
14
Relationships types
• one-to-one (1:1)
• one-to-many (1:M)
• many-to-many (M:N)
15
Relation types
• one-to-one (1:1)
16
Relation types
• one-to-many (1:M)
17
Relation types
• one-to-many (1:M)
18
Relation types
• many-to-many (M:N)
19
M:M
many-to-many (M:M)
20
M:M
21
Resolving many-to-many relationships
1. Find a link entity
Foreign key
24
Simple steps in entity modelling
1. List the possible entities.
2. Check that the entities listed are really entities.
3. Draw a basic entity model, with boxes around the entities.
4. Identify which entities are related. Draw a line between them.
5. Give the relationship a name in each direction.
25
Simple steps in entity modelling
26
Resolution and naming the relationships
27
Entity Modelling
• The systems analyst will need to communicate regularly with
the user
• during this process in order to check that all necessary
entities have been identified and that the relationships are
accurate.
28
CASE: Entity modelling at
Swillbuckets
29
Case: Swillbuckets
30
Case: Swillbuckets
Jack’s tasks are: booking the artistes, enrolling
new members, producing pay slips to pay the acts,
advertising future events and chasing up
subscriptions. Sometimes choosing the meat
dishes at the events.
31
Case: Swillbuckets
The problem background:
32
Case: Swillbuckets
The problem background:
33
Case: Swillbuckets
The problem background:
34
Case: Swillbuckets
After data flow modelling…
«Entity modelling»
35
CASE: Entity modelling at Swillbuckets
1.List the possible entities.
• An entity must be important to the
ARTISTE EVENT MEMBER organization.
• An entity must have at least one attribute.
• An entity must occur more than once.
DISH BREWERY DRINK • Each entity occurrence must be uniquely
identifiable.
RECIPE
SUPPLIER MEDIA
36
CASE: Entity modelling at Swillbuckets
2.Check that the entities are really entities.
37
CASE: Entity modelling at Swillbuckets
3. Draw the basic entity model
38
CASE: Entity modelling at Swillbuckets
4. Identify the relationships.
ARTISTEs attend EVENTs
40
CASE: Entity modelling at
Swillbuckets
5. Give the relationships
a name, in each
direction!!
41
CASE: Entity modelling at
Swillbuckets
6. Identify the type of
relationship.
each EVENT will only ever offer one
dish (in order to keep Freddo Smitho
just the right side of sane) and each
dish will be offered at many EVENTs.
43
CASE: Entity modelling at Swillbuckets
8. Resolve any many-to-many relationships.
44
CASE: Entity modelling at Swillbuckets
8. Resolve any many-to-many relationships.
45
CASE: Entity modelling at Swillbuckets
9 Add the attributes and keys.
• Primary keys are underlined.
• Attribute names have been condensed into one word with no spaces –
– spaces can cause problems in some systems. Capital letters are used
to denote a new word in the name.
• An asterisk denotes a foreign key –
– an attribute which acts as a link to another entity by appearing in both. It’s a
primary key in one entity but not in the other.
• Address attributes are shown as just one attribute, but in reality they are
– usually made up of a number of attributes e.g. Street, Town, County,
Postcode.
46
CASE: Entity modelling at Swillbuckets
47
Physical data store/entity cross-reference
1 List all the data stores, by checking the current
physical DFD
• M1 Membership shoebox
• M2 Artiste shoebox
• M3 Supplier shoebox
• M4 Events folder
• M5 Recipe book
48
Physical data store/entity cross-reference
2 Cross reference each data
store with corresponding
entities from the entity
model.
A data store can have more
than one entity
49
Physical data store/entity cross-reference
3 Check that each data store has at least one
entity.
4 Check that each entity is stored in a data store.
• We note that the entities EVENT TICKET and MEDIA
do not have data stores. The fact that EVENT TICKET
does not have a data store is expected.
50