Title: CM515100-1 Business Systems Analysis, Design and Construction BSADC
1CM515100-1 Business Systems Analysis, Design
and ConstructionBSADC
2Relational Data Analysis 1 Entity Modelling a
top down approach
3Last Week
- Last week we looked at
- Low Level DFDs - DFD2
- Elementary Process Descriptions
4Data Flow Diagrams - DFDs
- The symbols - basic outlines
5Whats missing from the so far?
- DFDs identify and specify
- Data Flows
- Activities, Processes, Functions
- Data Stores
- They DONT identify and specify the structure of
data stores (data tables)
6Objectives
- To discuss the 3 main concepts used in Entity
Modelling and Data Analysis - Establish those entities that are important to a
particular system - Understand the relationships between those
entities - Learn the associated structured modelling
techniques the notation
7The Three main Concepts
- 1. The Entity
- (please dont confuse with external entities)
- 2. The Relationship (between entities)
- 3. The Attribute (belonging to an entity)
8An Elementary Example
Student Number Student Name Street
Address Town Post Code Telephone
Module Number Module Name Module
Leader Level Cats Points
91. The Entity
- Is something we will need to hold data about
within the system - The context of the organisation determines
whether an entity has significance or importance
eg - To a hospital
- Patient, Doctor, Clinic, Ward
- To a Delivery Company
- Driver, Vehicle, Consignor, Consignee,
Consignment - To a University
- Student, Lecturer, Lecture, Room, Module,
Employee
10Drawing an entity
This is the symbol for the student entity
Student
Draw the symbol for the module entity
112. The Relationship 1
- There are relationships between entities
- The relationship can be illustrated by a joining
word or phrase - Entity Entity
- Customer places Orders
- Hotel has Rooms
- Guest makes Bookings
- Student registers for Modules
-
12Adding a relationship
This is the notation for the relationship
Draw the relationship between student and module
13The Relationship 2
- Sometimes an entity can have a relationship with
itself, for example, - Entity Entity
- Person is married to Person
- Employee reports to Employee
- Product made from a Product
is made of
Product
14The notation an example so far
15The Notation a further example
- There are different types of relationships
16Degrees of relationship
- Relationships between entities are more detailed
than first appears - One to One (11)
- Customer has only one and only one account
- One to many (1N)
- Customer may have many bank accounts
- Hotel has many rooms
- Many to Many (MN)
- Project has many workers
- Worker works on many projects
17Modelling Degrees of relationship 1
One to One (11)
18Modelling Degrees of relationship 2
Many to Many (MN)
19Intersection (or Link entity)
This gives rise to ambiguity of file structure
A more practical model is
20Optionality
- A relationship between two entities can also be
mandatory or optional - Mandatory - a customer must have placed an
order to be a customer - - hotel must have a room
- Optionality - a bus may have a passenger
- - a hotel room may have a guest
21Modelling Optionality 1
22Modelling Optionality 2
Order item
Invoice item
may
may
23Exclusivity
- Some entities show links between two other
entities - where the two links are mutually
exclusive
Room
Bedroom
Bathroom
Living Room
Living Room
24Adding Attributes
25- Entities have attributes (data items)
- Attributes record something about an entity
- For example - The entity PERSON
- Surname First name Title Gender
- Smith John Mr M
- Jones Davy Mr M
- Marple Mindy Miss F
- Thatcher Margaret Ms F
26Attribute types and Attributes 1
- Be careful when you read the terms attribute type
and attribute they are not the same thing - Attribute types will translate into the fields of
a record on a data table - Attributes are the values or properties that
identify or describe an entity occurrence
27Attribute types and attributes 2
- Entity Type Attribute Type Attribute
- Department Dept Name Accounts
- Building Canary Wharf
- Location Floor 3
- Dept Head Attila the Hun
- Cost Centre Code ACC3
-
28Getting started
- What are the data items associated with the
following LDS diagram?
29The Student
- Entity Type Attribute Type Attribute
- Student Student Name Jones
- Street Address Leek Road
- Town Stoke-on-Trent
- Post Code ST4 2DE
- Telephone 294303
30The Module
- Entity Type Attribute Type Attribute
- Module Module Name SSAT
- Module Leader A Lecturer
- Level 1
- Cats Points 10
31The Data items identified
32Identifying occurrences of entities
- Each occurrence of an entity should be uniquely
identified in some way - Imagine the British Gas data base that used only
surnames to identify account holders - There would be 100,000 account holders called
Jones in this country - Even if we used the given names there would still
be considerable duplication - It would be impossible to find the right account
by name alone
33Keys and Secondary keys
- Key
- a key is a data item used to identify a
particular occurrence of an entity. It may not be
unique so several entity occurrences may have the
same key - your surname is an example of a key
- Secondary Key
- a secondary key does not uniquely identify an
entity but helps to further identify an entity
occurrence - your given name is a secondary key
34Primary and Compound Keys
- Primary Key
- a primary key is a key consisting of a data item
that uniquely identifies an entity occurrence - your national insurance number is unique
- as is your passport number
- a gas bill number is unique
- as is a car registration
- Compound keys
- this is a primary key that is made up of two data
items - room number and date booking reference
- also there are Foreign and Composite keys
35Foreign Keys
- Foreign Key
- An attribute in on table that is a primary key in
another - More later
36Adding a Primary Key
37Getting it right
Is this right?
The real situation is
38Putting it right
We need a link entity - less ambiguity
Student
Module
Student Number Student Name Street
Address Town Post Code ST4 2DE Telephone
Stud/Mod
Module Number Module Name Module
Leader Level Cats Points
Student Number Module number Date
enrolled Grade achieved
Foreign Keys
More about this soon
39Self Study
- Read Mastering Systems Analysis and Design -
pages 67 to 78 - Do exercises 5.8.1 to 5.8.7
- Read handout
40Next week
41Tutorial
- The college case study
- The library case study