ims 5024 lecture 4 semester 2, 20021 ims 5024 data modelling

46
IMS 5024 Lecture 4 Semest er 2, 2002 1 IMS 5024 Data Modelling

Post on 20-Dec-2015

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

1

IMS 5024

Data Modelling

Page 2: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

2

Content

• Individual assignment• Pitfall revisited• Group assignment• Class assignment• Nature of data modelling• Tools/Techniques used in data modelling• Place in ISD• Evaluation of data modelling• Reading list

Page 3: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

3

Individual assignment

Date due: 29 August 2002 – Difference between social and

technical–Show understanding of the

subject matter–Questions e-mail Bahar directly

Page 4: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

4

Teaching Assistant

• Bahar Jamshidi

• E-mail: [email protected]

• Queries about marks• Other queries

Page 5: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

5

Pitfalls

• Not starting early

• Reading, more reading and then some reading.

• Plagiarism !!!!!

Page 6: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

6

Data modelling describe:

Page 7: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

7

Data modelling describe:

• Structure

• Meaning

• Relationship

Of Data

Page 8: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

8

Data modelling help us to grasp:

• Static Data in the organisation

• Fundamental building block of the system

• Two perspectives (Process and Data)

Page 9: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

9

Techniques used in Data modelling

• Entity relationship diagrams

• Normalisation

• Data Dictionary

• What difference?

• Use both?

Page 10: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

10

Entity

• Entity – things of interest to the business

• Identification of an entity is subjective• Entities can be:

• Real eg product

• Abstract eg Quota

• Event remembered eg sale

• Role played eg employee

Employee

Page 11: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

11

Relationship

• Relationship Between entities

• Cardinality (eg. One to many, one to one ect.)

• Degree of relationship (Unary, Binary, Ternary)

DepartmentEmployee

Page 12: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

12

Examples of Cardinalities

PATIENTHISTORY

PATIENT

PROJECT

EMPLOYEE

PERSON

Mandatorycardinalities

Optional and mandatorycardinalities

Optionalcardinalities

Has

Is assigne

d to

Is married

to

Page 13: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

13

Relationship Cardinality Summary

Mandatory 1 cardinality

Many cardinality (1,2 …m)

Optional (0 or 1) cardinality

Optional (0 or many) cardinality

Page 14: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

14

Unary Relationship

• Also called a recursive relationship

PERSON EMPLOYEE

One to manyOne to one

Ismarried

to

Manages

Page 15: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

15

Binary Relationship• A binary relationship is a relationship

between instances of two entity types.

PROJECT

EMPLOYEE

SALESORDER

CUSTOMER

ITEM

SUPPLIER

One to one One to many Many to many

Leads PlacesSupplie

s

Page 16: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

16

Ternary Relationship• A ternary relationship is a relationship

between instances of three entity types.

PART

suppliesVENDOR CUSTOMER

Page 17: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

17

Attributes

• What we want to know about the entity or a relationship

• Types:– Derived,– multi-valued, – Composite,– Simple

Page 18: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

18

Example of attributes

EMPLOYEE

Emp-no

Name Address

Skill

Page 19: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

19

Why normalisation?

• Remove redundancy and incompleteness

• Bottom up process

• Rely on Maths – well researched

Page 20: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

20

Determining columns

• One fact per column

• Hidden data

• Derivable data

• Determining the key

Page 21: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

21

Steps in Basic Normalisation• Basic Normalisation is most often accomplished in

three stages (these are the three basic normal forms)

First Normal Form

Second Normal Form

Third Normal Form

Unnormalised table

Remove repeating groups

Remove partial dependencies

Remove transitive dependencies

Page 22: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

22

First normal form

Step 1: Remove the repeating group• Why is repeating groups a problem?• Determine the key for the new group.

Order-Item (Order#, Customer#, (Item#, Desc, Qty))

Order-Item (Order#, Item#, Desc, Qty)

Order (Order#, Customer#)

Page 23: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

23

Second and Third normal forms

• Eliminate redundancy

• Determinates – one or more columns which determines other column values

Page 24: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

24

Second and third normal form procedure

• Identify any determinates (other than the key)

• Establish a separate table for each determinate and the columns it determines

• Name the new tables

• Remove the determined columns from the original table

Page 25: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

25

Third normal form

A table is in third normal form if the only determinates of nonkey columns are candidate keys

Page 26: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

26

Advanced normalisation

• A set of tables can be in 3NF and still not be fully normalised

• Further stages of normalisation are BCNF, 4NF, 5 NF and Domain key NF

Page 27: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

27

Higher Normal forms

• Occur infrequently

• Most tables in 3 NF is already in BCNF, 4NF and 5 NF

• Data in 3NF but not in 5NF has– Redundancy– Insert/update/delete anomalies– Difficulty in storing facts independently

Page 28: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

28

BC NF

Example

Branch-customer relationship (customer no, branch no, visitng frequency, date relationship established, salesperson no)

BRANCHCUSTOMER

RELATIONSHIP

CUSTOMERBRANCH

SALES-PERSON

Page 29: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

29

Problem• Salesperson branch no• Overlapping and candidate keys

Customer no and branch no

&

Customer no and salesperson

Branch-customer relationship (customer no, salesperson no, branch no, visiting frequency, date relationship established)

Customer salesperson relationship (customer no, salesperson no, visiting frequency, date relationship established)

Salesperson (Salesperson No, branch no)

Page 30: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

30

B-C NF

Every determinant must be a candidate key (must have overlapping keys)

BRANCHCUSTOMER

RELATIONSHIP

CUSTOMER

BRANCH

SALES-PERSON

Page 31: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

31

Fourth and Fifth NF

• Apply to all-key tables, degree > 2

INSTRUMENTDEALER

LOCATION

Page 32: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

32

Problems are the result of multi-valued dependencies

Page 33: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

33

Fifth NF

Keep splitting tables until:

– Any further splitting would lead to tables unable to be joined to produce the original table

– The only splits left are trivial

Page 34: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

34

Dealing authority problem

Page 35: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

35

Many to many relationships resolved

Page 36: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

36

Combined table

Page 37: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

37

Combined table which cannot be split

Page 38: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

38

Other normalisation issues

• Normalisation and redundancy– Overlapping classifications– Derivable data

• Selecting primary keys

Page 39: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

39

Thinking in Data modelling

• Hard Vs Soft ??

• Perspective– Objective vs Subjective– Nature of the organisation

Page 40: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

40

Evaluation of Data modelling

Problem oriented Product oriented

Concep-tual

Structured analysis

Entity relationship modelling

Logical construction of systems

Modern structured analysis

Object oriented analysis

Structured design

Object oriented design

Formal PSL/PSA

JSD

VDM

Levels of abstraction

Stepwise refinement

Proof of correctness

Data abstraction

JSP

Object oriented programming

Page 41: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

41

Advantages of Data modelling

• Data model is not computer oriented (agree??) • Model understandable by technologist and users• Does not show bias• UoD can vary (whole organisation or department)• Readily transformable into other models• Different data analysis techniques• Data modelling is rule-based

Page 42: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

42

Disadvantages

• Does not encourage/support user participation

• Your view on the organisation –people or data

• The idea that the model is THE model• Subjective view• One-side ito data• Others??

Page 43: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

43

Advantages of Normalisation

• Rid the data of redundancy and other problems

• Very well researched

• Math basis for normalisation

Page 44: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

44

Disadvantages of normalisation

• Does not encourage/support user participation

• Your view on the organisation –people or data

• One-side ito data• Can be done mechanistically without

thought• Others??

Page 45: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

45

Process modelling view of ISD

Development group

Objectives

Environment

Object system

ObjectsystemChange

process

Hirschheim et al see reading list

Page 46: IMS 5024 Lecture 4 Semester 2, 20021 IMS 5024 Data Modelling

IMS 5024 Lecture 4 Semester 2, 2002

46

Reading for next week

• Johnstone, M.N., McDermid, D.C. (1999). Extending and validating the business rules diagram method. Proceedings of the 10 th Australian Conference on Information Systems.

• Chapter 2 of Curran, Keller, Ladd (1998). SAP R/3 the business blueprint: Understanding the business process reference model. Prentice Hall.