data modeling and relational database design. describe the phases of the database development...

28
Overview of Database Development Data Modeling and Relational Database Design

Upload: myra-kellie-stevenson

Post on 26-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Overview of Database Development

Data Modeling and Relational Database Design

Page 2: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Objectives

Describe the phases of the database development process

Describe the phases of the application development process

Explain conceptual data modeling and database design

Page 3: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

SYSTEM DEVELOPMENT LIFE CYCLE

StrategyandAnalysis

Design

BuildandDocument

Transition

Production

Page 4: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Database Development Process

Function Modeling

Application Design

Application Build

ER model,entity definition

Business Requirements

ConceptualData Modeling

Database Design

Database Build

Table, index,view

Function hierarchy, function definition

Module (screen, report, menu, program design)

ApplicationDatabase

Information Process

Cross-checking

Cross-checking

Operational System

Page 5: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Database Development ProcessBusiness Information Requirements

Operational Database

Conceptual Data Modeling

Logical Database Design

Physical Database Build

Business view

Systems view

Page 6: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

TerminologyLOGICALCONCEPTUAL

DESIGN

ENTITY

RELATIONSHIP

ATTRIBUTE

TABLE

FOREIGN KEY

COLUMN

(Business view) (Systems view)

ANALYSIS

UNIQUE IDENTIFIER

PRIMARY KEY

UNIQUE KEY

Page 7: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Information Models

Organize thought processes

Accurately model business data

Communicate with stakeholders

Analyze the scope

Provide sound basis for system design

Page 8: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Goals of Conceptual Data Modeling

Robust syntax

User communication

Ease of development

Definition of scope

Integration of multiple applications

Page 9: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Modeling Basic Entities and Attributes

Page 10: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Overview

Why conceptual modeling?

Introduction of the Key role players:EntitiesAttributesRelationships

Page 11: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Why Create a Conceptual Model?

It describes exactly the information needs of the business

It facilitates discussion

It helps to prevent mistakes, misunderstanding

It forms important “ideal system” documentation

It forms a sound basis for physical database design

It is a very good practice with many practitioners

Page 12: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Conceptual Model Between Dream and Reality...

Page 13: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entity Relationship Modeling

• Models business,not implementation

• Is a well-established technique

• Has a robust syntax

• Results in easy-to-read diagrams…

...although they maylook rather complex at first sight

SUP PLIE R# SUPPL IER COD Eo EMAIL* APPROV ED* RE FERENC E

OTHER ORGAN IZATION

ORGAN IZ ATIONo E MAIL* N AMEo POS T A L CODEo REGI ONo STR E ETo TOWNo TELEP HONE NUMBERo CONTACT NAM Eo CON T ACT E XT E NSION

MEMBERSHIP T YPE# C OD E* DESCR IPTION* DISCOUN T PE R CE N T AGEo STA N DAR D F E E

MEMBERSHIP P E RIOD# ST A R T DATEo ACTU AL FEE PA ID

MEMBERS HIP# NUMBERo TERM INATION R EASONo TERMI NATION DAT E

EMPLOYEE* POSITION* LAST NAMEo FIRST NAMEo OTHER I NI T IALSo E M A IL

BOOK I N G* BOO K DA T Eo EXPIRE DA TEo NOT IF Y D ATEo RESERVE DATEo STA F F REMARK S

RENTAL ITEM# LINE NO* RENTAL PERIOD* PRICE PAIDo RETURN D ATEo STAF F REMARKS

RENT AL* RE N T AL DATEo ST A F F REMARKSo COMP LETED

COPY* ACQUIR E DATE* PURCHAS E CO S T* SHELF CO DEo CO ND ITIO No C USTO M ER REMARKS...

REVIEW# SEQ U ENC E* ARTI CLE* HO To AUTHO Ro URL

PUBLICATION# REFERENCE* T ITLEo VOLUMEo I SSUEo PUBLISH DATE

CUS TOMERo EMAIL* DE S IG NATION* FIRST N A ME* LAS T NA M Eo OTHER INI T IALS* STRE ET* TO W N* POSTAL CODE* REGIONo HO ME PHO N Eo WORK EX T ENSIONo WOR K PHONEo PHOT OGRAPHo STAF F REMAR KS

CATALOG# REFERENCEo CATALOG DATEo DESCRIPTION

MOVIE* CATEGORYo AGE RATING* DURA TION* MONO CHROMEo AUDIOo PREVIEW

GAME* CATEGORY* MEDIUMo MINI MUM MEM OR Y

TITLE# PR O DU CT CODE* TITLEo DESCRIPTION

PRICE L EV E L# CODE* DESCRIPTION

PRICE HISTORY# EFFECTIVE DATE* PRIC E* DEFA ULT DAY S* OVERD UE RATE

for

us ed f or

of

re newed for

of

the ty p e of

held b y

the hold er of

hel d by

the h ol d er of

av ailablefrom

thedistribut o r for

requestedagain st the

requestorof

authorized by

respon s i b l efor

the rese rvation f o r

reserved on

for

on

cance l le d by

the canc e ll o r of

appro ve d by

responsi ble for

of

reviewed in

at

applie d to

the rent al for

fulfilled as

par t of

compo se d of

for

r e n ted on

approv e d b y

respo n si blefor

par t o f

parent org a ni za tion of

acqui re d from

the source of

of

available as

for

d ef ined by

m a na ged b y

the m anager of

in

the sour c e o f

in

the so u rce of

Page 14: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Goals of Entity Relationship Modeling

Capture all required information

Information appears only once

Model no information that is derivable from other information already modeled

Information is in a predictable, logical place

Page 15: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

CONCEPTUAL DATA MODELS

Model of systemin client’s mind

Entity model ofclient’s model

Table modelof entity model

Tables on disk

Server

Page 16: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Database Types

HierarchicalRelational

Network

ER Model

Page 17: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

ENTITY RELATIONSHIP MODEL

EMPLOYEE#* number* nameo job title

DEPARTMENT#* number* nameo location

assigned toassigned to

composed ofcomposed of

Create an entity relationship diagram from business specifications or narratives

Scenario– “. . . Assign one or more employees to a department . . .”– “. . . Some departments do not yet have assigned employees .

. .”

Page 18: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entity

An Entity is:“Something” of significance to the business about which data must be known.A name for the things that you can list.Usually a noun.

Examples: objects, events

Entities have instances.

Page 19: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Identify and Model Entities

Identify a nounIs it significant?Is there information about it that the business needs to keep?Is it a group or an instance?

Name the entity

Write a description of it

Identify a few attributes

Draw a soft box for it

Page 20: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entity Instances

EMPLOYEE DEPARTMENT

Personnel Finance Sales

Head office

Page 21: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Identifying a Unique Instance

EMPLOYEE

badge numbernamedate of birthsalary

Page 22: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entities and Instances

PERSON

PRODUCT

PRODUCT TYPE

EMPLOYMENT CONTRACT

JOB

SKILL LEVEL

TICKET RESERVATION

PURCHASE

ELECTION

PRINTER PREFERENCE

DOCUMENT VERSION

Mahatma Gandhi

2.5 x 3.5 mm copper nail

Nail

My previous contract

Violinist

Fluent

Tonight: Hamlet in the Royal

The CD I bought yesterday

For parliament next fall

Page 23: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entities and Sets

dish washer

JOB

waiter

cookwaitress

manager

financial controllerporter

piano player

• An entity represents a set of instances that are of interest to a particular business.

Page 24: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Attribute

Also represents something of significance to the business

Is a single valued property detail of an entity

Is a specific piece of information that: DescribesQuantifiesQualifies Classifies Specifies

an entity.

Page 25: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Attribute Examples

Entity

EMPLOYEE

CAR

ORDER

JOB

TRANSACTION

EMPLOYMENT CONTRACT

Attribute

Family Name, Age, Shoe Size, City, Email, …

Model, Weight, Catalog Price, …

Order Date, Ship Date, …

Title, Description, ...

Amount, Transaction Date, …

Start Date, Salary, ...

Page 26: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Entity Representation in Diagram

Drawn as a “softbox”

Name singular

Name inside

Neither size, nor position has a special meaning

EMPLOYEE

TICKETRESERVATION

JOB ASSIGNMENT

JOB

ORDERE

LEC

TIO

N

During design, entities usually lead to tables.

Page 27: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

Attributes in Diagrams

*o

EMPLOYEE* family Name address birth Dateo shoe Sizeo email

JOB titleo description

During design, attributes lead to columns.

*

Mandatory attribute, that is, known and available for every instance

Optional attribute, that is, unknown or unimportant to know for some instances

o

*

Page 28: Data Modeling and Relational Database Design. Describe the phases of the database development process Describe the phases of the application development

ENTITY RELATIONSHIP MODELING CONVENTIONS

EntitySoft boxSingular, unique nameUppercaseSynonym in parentheses

AttributeSingular nameLowercaseMandatory marked with “*”Optional marked with “o”

Unique Identifier (UID)Primary marked with “#”Secondary marked with “(#)”

EMPLOYEE#* number* nameo job title

DEPARTMENT#* number* nameo location

assigned to

composed of