information access mgt09/12/971 entity-relationship design information level design

28
Information Access Mgt 09/12/97 Entity-Relationship Design Information Level Design

Upload: loren-fowler

Post on 18-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 1

Entity-Relationship Design

Information Level Design

Page 2: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 3

The Data Life CycleStage Tool Objective

InitialInvestigation

Report General Scope

Feasibility Function-EntityDecomposition

Business Entities

GeneralAnalysis

E-R Diagram Logical Entities

DetailedDesign

Schema Physical Design

Coding SQL Specify DBMS

Installation Population Plan Initialize Tables

Page 3: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 4

Data Modeling StagesStage Goal Outcome

BusinessScope

Business justificationfor system

Data PlanPPrriioorriittyy lliisstt

BusinessModel

Data requirements inbusiness terms

Project OrganizationCCRRUUDD MMaattrriicceess

IT Model High level technicaldescription

Conceptual DesignEE--RR DDiiaaggrraammss

TechnologyModel

Database specificdesign

Physical DesignNNoorrmmaalliizzeedd TTaabblleess

TechnologyDefinition

Data Definitionspecifications

Table SchemaSSQQLL rreeqquuiirreemmeennttss

DatabaseSystem

Functional Database Populated DatabaseMMaannaaggeemmeenntt ppllaann

Page 4: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 5

Babysitter Service

The AITP Service Club wants to run a babysitting service. Customers call to request a sitter and the Club Coordinator assigns an employee to sit for the customer from a list of employees available for the particular day requested.

Page 5: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 6

The Data Life CycleStage Tool Objective

InitialInvestigation

Report General Scope

Feasibility Function-EntityDecomposition

Business Entities

GeneralAnalysis

E-R Diagram Logical Entities

DetailedDesign

Schema Physical Design

Coding SQL Specify DBMS

Installation Population Plan Initialize Tables

Page 6: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 7

The Data Life CycleStage Tool Objective

InitialInvestigation

Report General Scope

Feasibility Function-EntityDecomposition

Business Entities

GeneralAnalysis

E-R Diagram Logical Entities

DetailedDesign

Schema Physical Design

Coding SQL Specify DBMS

Installation Population Plan Initialize Tables

Page 7: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 8

Functional Decomposition

Assign Employee• Take Call• Check Availability• Assign to Job• Contact Employee• Confirm Appointment

Determine Availability

Page 8: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 9

Functional-Entity Decomposition

Employee Customer Job

Assign Employee

Take Call U

Check Availability R

Assign to Job R R U

Contact Employee R R

Confirm Appointment R UDetermineAvailability

U

Page 9: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 10

The Data Life CycleStage Tool Objective

InitialInvestigation

Report General Scope

Feasibility Function-EntityDecomposition

Business Entities

GeneralAnalysis

E-R Diagram Logical Entities

DetailedDesign

Schema Physical Design

Coding SQL Specify DBMS

Installation Population Plan Initialize Tables

Page 10: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 12

E-R Diagram

Employee

Job

Customer

Page 11: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 14

Data Flow DiagramContext Diagram

Babysitter InformationSystem

Customer

Employee

Request

Confirm-ation

Assignment

Availability

Page 12: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 15

Data Flow DiagramLevel 1

Request

Confirm-ation

1.AssignEmployee

Availability2.Record Avail-ability

Assignment

D1 | Customer

D2 | Employee

New

Current AvailTimes

D3 | Jobs

JobAssign

AvailTimes

Page 13: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 17

Entity Relationship Models

A good E-R model has• One table for every entity in the business

system• Correctly drawn relationships indicating 1-1

or 1-m cardinalities• Optionality indicators to support needed

referential integrity

Page 14: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 20

ATTRIBUTE:

A description or property of a given entity type.

• Must depend on the entity key alone • Must contain information that we

explicitly need• Must have the same data type for all

entity occurrences

Page 15: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 23

Discovering Entities

• Entities are normally described by NOUNS and ADJECTIVES

• Entities do not change anything.• Entity occurrences are records, entity types

are files.• Reports are derived output and not entities.

Page 16: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 28

Keys

Names are normally poor primary keys. They have multiple valid representations. Primary keys:

1. Should not change values over the life of the instance.

2. Should not have null values.

3. Should not be "intelligent keys". These are keys that also describe properties of the entity.

4. Should not be large composite keys.

Page 17: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 29

Not null vs nulls allowed

• Null values represent inapplicable, applicable but not known, and applicable but not present values. Primary keys cannot have null values.

• Null values are different from zeros or blanks

Page 18: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 31

Diagrams: Attributes

Entity

Key . . . . . .Attribute Attribute

Page 19: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 32

Diagrams:Repeating Groups

Course

SectionNum

Page 20: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 34

PREMIERE PRODUCTS EXAMPLE

The Premier Products Company is a wholesale hardware company that provides products to customers. Each customer is served by a salesman who processes orders. The salesmen is paid from commissions earned on each customer order. A customer places an order by calling the company and contacting the salesman. The salesman records the ordering person, products and quantity ordered.

Page 21: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 35

PREMIERE PRODUCTS: REPEATING GROUPS

In the Premier Products Company each salesmen is paid from commissions earned on each customer order. A customer places an order by calling the company and contacting the salesman. The salesman records the ordering person, products and quantity ordered. The order consists of Customer data, Salesman data and a list of products, price, and quantity for the products that the customer wants delivered. The attributes {PRODUCT, PRICE, QUANTITY} constitute a repeating group.

Page 22: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 36

Example: Order

ORDER PRODUCT PRICE QUANTITY

5103 IRON 17.95 11

SKILLET 19.95 6

5110 TOASTER 57.95 4

IRON 17.95 3

Each instance of an order has several order lines. Order lines {Description, Price, Quantity} are examples of repeating

groups.

Page 23: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 38

RELATIONSHIP.

Does not describe processing or change any data. Relationship names should be passive (ordered by).

• CARDINALITY Refers to the number of records that a relationship connects to a given child record in a relationship.

• PARTICIPATION (Optionality) Refers to whether a record must exist in one table before a related one is inserted into another.

Page 24: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 39

Diagrams: 1:m Relationships

Section

Instructor

CourseSection

InstructorID

InstructorID

Page 25: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 40

Diagrams:m:n Relationships

Section

Student

CourseSection

StudentID

Student-Section

CourseSection

StudentID

Page 26: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 41

Optionality(Referential Integrity)

Records in a table that have a relationship with another table may be restricted by optionality requirements.

Relationship Optional Relationship Mandatory (referential

integrity enforced)

Page 27: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 42

Optionality

0

1

Optional (0 allowed)

Mandatory (1 or more required)

Page 28: Information Access Mgt09/12/971 Entity-Relationship Design Information Level Design

Information Access Mgt 09/12/97 45

Data