Professional Documents
Culture Documents
DataModel
DataModel
DataModel
member is a member of
Employee Employee number First name Last name Employee function Employee salary
subcontract
staffed by
is assigned to
Project Project number Project name Project label Start date End date
References
Data Modeling and Data$a%e De%ign 1. 4atini, Ceri, Na&athe, Conceptual Database Design, !ed+ood Cit*, C.2 he 4en1amin<Cumming% Pu$li%hing Com'an*, Inc., 1992. 2. eore*, . =., Database Modeling and Design: The Entity-Relationship Approach, Morgan >au)mann Pu$li%her%, Inc., 1990. 3. homa% .. 4ruce, Designing Quality Databases with DE!"# nfor$ation Models, Dor%et 0ou%e Pu$li%hing, N-2 Ne+ -or?, 1991. @. e6a% In%trument%, A %uide to E &sing E!, 2nd edition, Part No. 2A39ABC-0001, 1990. B. Martin, =ame%, nfor$ation Engineering 'oo( : )lanning and Analysis, Prentice0all Inc., 19D9. C. Da&e ,n%or, Ian /te&en%on, Oracle Design, "E!eill* 3 .%%ociate%, 199A A. !o$ :illette, etc., )hysical Database Design for *ybase *Q+ *er,er, Prentice 0all, 199B. D. !al'h >im$all, The Data -arehouse Tool(it, ;ile*, 199C. =.D !e)erence% 1. .ugu%t, =. 0.. .oint Application Design: The %roup *ession Approach to *yste$ Design. ,ngle+ood Cli))%, N-, Prentice 0all, Inc., 1991. 2. ;ood, =. and /il&er, D. .oint Application Design: /ow to Design Quality *yste$s in 012 +ess Ti$e. Ne+ -or?, N-, =ohn ;ile* 3 /on%, 19D9. 3. .ndre+%, D. C. and (e&enthal, N. /., !usion: ntegrating E3 CA*E3 and .AD: A /andboo( for Reengineering the *yste$s Organi4ation, ,ngle+ood Cli))%, N=2 -ourdon Pre%%, 1993.
! Minder Chen, 1993~2002 Data Modeling - 3 -
" /*%tem% De&elo'ment (i)e C*cle F/D(CG in a Client</er&er ,n&ironment " Introduction to Data Modeling " Data$a%e De&elo'ment (i)e C*cle "&er&ie+
Data Modeling - @ -
" ,! modeling techniHue i% the ma1or data modeling method in In)ormation ,ngineering and i% +idel* %u''orted $* mo%t o) C./, tool%. " Data modeling i% the )oundation o) mo%t data$a%e-centered tran%action 'roce%%ing %*%tem% and data +arehou%e %*%tem%
Data Modeling - C -
" !,-D,/I:N current %*%tem% " !,-0"/ current %*%tem% " !,-IM.:, current %*%tem%
("; (";
! Minder Chen, 1993~2002 Data Modeling - A -
Data /'ace
Client
" " " " " Pre%entation logic (ocal in'ut &alidation "ut'ut 'roduction logic (ocal 'eri'heral dri&er% Per)ormance critical 'roce%%ing " " "
/er&er
5unction% that acce%% data on the %er&er 5unction% that need in'ut )rom multi'le u%er% 5unction% that coordinate the +or? o) %e&eral u%er
I%%ue%2
" " " " "
! Minder Chen, 1993~2002
Di%tri$ution o) data Plat)orm-%'eci)ic ca'a$ilitie% and intero'era$ilit* Connecti&it* ca'a$ilitie%<'lat)orm 5reHuenc* o) change to code% Con)iguration management
Data Modeling - D -
.''lication (ogic
Proce%% 5lo+
Program%, Procedure%
Data Model
a$le%, Inde6e%
/ource2 Da&id 9a%?e&itch, Client</er&er /trategie%, ID: 4oo?%, 1993. Data Modeling - 9 ! Minder Chen, 1993~2002
Proce%%e% 4eha&ior
.rchitecture
Conce'tual F,nter'ri%eG D4 /chema (ogical D4 De%ign . logical D4 %chema i% a de%cri'tion o) the %tructure o) the data$a%e that can $e 'roce%%ed $* a D4M/2 relational, net+or?, or hierarchical.
. 'h*%ical D4 %chema i% a de%cri'tion o) the im'lementation o) the data$a%e in e6ternal memor*L it de%cri$e% the %torage %tructure% and acce%% method% u%ed in order to e))ecti&el* acce%% and maintain data.
(ogical D4 /chema
Ph*%ical D4 De%ign
Ph*%ical D4 /chema
/ource2 4atini, C., Ceri, /., and Na&athe, /. 4., Conceptual Database Design: An EntityRelationship Approach, he 4en1amin<Cumming% Pu$li%hing Com'an*, Inc., 1992. Data Modeling - 11 ! Minder Chen, 1993~2002
Multiple )erspecti,es
)e use this data
$%E &'S(%ESS
)e do these things
D. .
.C I9I -
0I!, ,MP("-,,
P.,MP("-,,
5I!, ,MP("-,,
Data Modeling - 12 -
Mem$er
.greement
%ell%L i% %old on
generate%L generated $*
Product
Promotion
%'on%or%L i% %'on%ored $*
Clu$
Data Modeling - 13 -
" /u$1ect .rea and /u$1ect .rea Diagram " ,ntit* *'e% " ,ntit* In%tance% " 5inding ,ntit* *'e% " ,&aluating ,ntit* *'e%
Data Modeling - 1@ -
Pro1ect%
Pro1ect Mem$er a%?
Pro1ect
! Minder Chen, 1993~2002 Data Modeling - 1B -
Customers
Sales-persons
Legends
Entity Types
" De)inition2
# .n entit* i% an o$1ect or e&ent, real or a$%tract, a$out +hich +e +ould li?e to %tore data. ,ntit* i% the a$$re&iation o) entit* t*'e. It re're%ent a %et o) entit* in%tance% +hich can $e de%cri$ed $* the %ame %et o) attri$ute t*'e%. he &alue o) the %ame attri$ute )or each entit* in%tance ma* $e di))erent.
# Cu%tomer, Cu%tomer "rder, Product, 0ourl* ,m'lo*ee, Pro1ect, De'artment, #n)illed Cu%tomer "rder
4e clear and conci%e .&oid a$$re&iation 4e con%i%t +ith u%erN% terminolog* Identi)* %*non*m%
# Cu%tomer # Product # /u''lier eacher # Client Merchandi%e 9endor 5acult*
" #%e one name a% the o))icial name and document other% a% alia%e%
Data Modeling - 1D -
Data Modeling - 19 -
Data Modeling - 20 -
Definition of an Entity Type " . 'oor de)inition o) Cu%tomer2 .n*one that $u*% %omething )rom the com'an*.
# Can em'lo*ee% $e a cu%tomerK # Can a lea%or $e a cu%tomerK # I) the com'an* %old a %u$%idiar* to another com'an*, doe% the ne+ o+ner con%ider a cu%tomerK
%ood Definition
" Com'ati$le
# Cu%tomer2 .n "!:.NI7. I"N that 'urcha%e P!"D#C % )or 'er%onal u%e. # Di%tri$utor2 .n "!:.NI7. I"N that 'urcha%e P!"D#C % )or re%ale.
" Preci%ion2
# ;ith a''ro'riate Huali)ier% # ,6am'le2 .n "!:.NI7. I"N i% con%idered to ha&e 'urcha%e a P!"D#C +hen +e recei&e a &alid P#!C0./, "!D,! )rom it.
" Com'lete
# "!:.NI7. I"N, P!"D#C , P#!C0./, "!D,! need to $e de)ined.
Entity Type
Cu%tomer Product !a+-material /u''lier 4u*er
Description
In)ormation a$out all 'er%on% or organi8ation% +ho 'urcha%e%
.ll good% manu)actured and %old Com'onent% u%ed to manu)acture Product%. 9endor% o) !a+ Material%.
Com'an* 'er%onnel re%'on%i$le )or 'urcha%ing !a+-Material% )rom /u''lier%
Data Modeling - 23 -
Entity Type and Entity nstance 6Occurrence7 ,ntit* *'e% 9endor ,m'lo*ee Cour%e De'artment ,ntit* In%tance .4C Co. =ohn /mith Intro. to I,
Mar?eting De'artment
Data Modeling - 2@ -
" Mar*land " "rgani8ation #nit " Cu%tomer " Pre%ident " 4ill Clinton " De'artment o) Commerce " .ddre%%
Data Modeling - 2B -
!inding Entity Types " " " " " " Inter&ie+% +ith u%er% =.D +or?%ho'% 4u%ine%% )orm% !e'ort% Com'uter )ile% u%ing re&er%e engineering "'eration manual%
Data Modeling - 2C -
" !e%ource%
# .n* re%ource% that an organi8ation need% to manage %hould $e re're%ented a% an ,ntit* *'e. In)ormation a%%i%t% the e))icient and e))ecti&e u%e o) other re%ource% through im'ro&ed deci%ion. # ,6am'le%2 In&entor*, Machine, 4an? .ccount, and Cu%tomer.
" ,&ent%
# ,&ent% are incident% that occur at 'oint% in time. .n e&ent o)ten in&ol&ed an interaction $et+een t+o ,ntit* *'e% or an action that change% the %tatu% o) an ,ntit* *'e. # ,6am'le%2 /ale, Deli&er*, and !egi%tration o) a motor &ehicle.
Data Modeling - 2A -
' A T:
" " " "
.nal*%i% o) "rder% "rdered entitie% can $e a thing, a %'ace, or a %?ill. 9ie+ the order )rom %u''lier %ide. I) an organi8ation recei&e% no order%, it ha% no rea%on )or e6i%ting. " .n organi8ation unit can recei&e multi'le t*'e% o) order%. " @ Hue%tion% a$out the /u''lier2
# # # # 4illing FCa%hGK Deli&er (ate FImmediateGK Pro)ile cu%tomerK Negotiate 'rice F5i6edGK
Data Modeling - 29 -
" !elation%hi'% " ,ntit* !elation%hi' Diagramming Notation " .ttri$ute% " Identi)ier% " Partitioning and ,ntit* /u$t*'e%
Data Modeling - 30 -
Relationship 6Type7
" De)inition
# . !elation%hi' *'e i% an a%%ociation among ,ntit* *'e%. It indicate% that there i% a $u%ine%% relation%hi' $et+een the%e ,ntit* *'e%. # !elation%hi' Mem$er%hi' i% the 'artici'ation o) an ,ntit* *'e in a !elation%hi'. # In I,, a !elation%hi' *'e can in&ol&e onl* t+o ,ntit* *'e% F$inar* relation%hi'G. /ome other modeling techniHue% allo+ n-ar* relation%hi'%.
" ,6am'le%
# # # # C#/ "M,! 'lace% "!D,! "!D,! i% 'laced $* C#/ "M,! ,MP("-,, +or?% on P!"=,C P!"=,C ha% 'ro1ect mem$er ,MP("-,,
Data Modeling - 31 -
,ntit* In%tance
/tudentO1 /tudentO2
Cour%eO. Cour%eO4 Cour%eOC Cour%eOD
Cour%e
!elation%hi'
/tudent ta?e% Cour%e
! Minder Chen, 1993~2002
!elation%hi' Paring
/tudentO1 ta?e% Cour%eO. /tudentO1 ta?e% Cour%eO4 /tudentO1 ta?e% Cour%eOD /tudentO2 ta?e% Cour%eO. /tudentO2 ta?e% Cour%eOC /tudentO2 ta?e% Cour%eOD
Data Modeling - 32 -
" De)inition2 . collection o) 'airing% o) a !elation%hi' Mem$er%hi' in +hich an ,ntit* In%tance i% in&ol&ed. " ,6am'le%2
# /tudentO1 ta?e% Cour%eO., O4, and OD # /tudentO2 ta?e% Cour%eO., OC, and OD # Cour%eO. i% ta?en $* /tudentO1 and /tudentO2
Data Modeling - 33 -
Relationship Cardinality
One-to-One One-to-One
121
! "
One-to-#any One-to-#any
12M
"
#any-to-#any #any-to-#any
M2N
"
Data Modeling - 3@ -
Relationship Cardinality
" he num$er o) ,ntit* In%tance% in&ol&ed in the !elation%hi' In%tance% :rou'ing in a !elation%hi' *'e. " hree 5orm% o) Cardinalit*
1. "ne-to-one F121G D,P.! M,N ha% M.N.:,! ,ach D,P.! M,N ha% one and onl* one M.N.:,! ,ach M.N.:,! manage% one and onl* one D,P.! M,N 2. "ne-to-man* F12mG C#/ "M,! 'lace% "!D,! ,ach C#/ "M,! %ometime% F9BPG 'lace one or more "!D,!% ,ach "!D,! al+a*% i% 'laced $* e6actl* one C#/ "M,! 3. Man*-to-man* Fm2nG IN/ !#C "! teache% C"#!/, ,ach IN/ !#C I"N teache% 8ero, one, or more C"#!/,% ,ach C"#!/, i% taught $* one or more IN/ !#C "!%
Data Modeling - 3B -
,ntit*-Q
re&er%ed-relation-de%cri'tion
,ntit*--
min ma6 ran%late ran%lateinto intot+o t+o%tructured %tructured%tatement% %tatement% ,ach ,ntit*-Q relation%hi'-de%cri'tion cardinalit*-indicator Fone-or-man*G ,ntit*--
De'artment
i%-managed-$* manage%
Manager
Data Modeling - 3C -
Optionality of Relationship Me$berships " ;hether all entit* in%tance% o) $oth entit* t*'e% need to 'artici'ate in relation%hi' 'airing. " "'tionalit*2
# Mandator* # "'tional
" ,6am'le2
# C#/ "M,! mem$er%hi' i% o'tional # "!D,! mem$er%hi' i% mandator*
'lace%
C#/ "M,!
! Minder Chen, 1993~2002
i% 'laced $*
"!D,!
Data Modeling - 3A -
Relationship *tate$ents
:ra'hical :ra'hicalNotation% Notation%
C#/ "M,!
i% 'laced $*
"!D,!
8ero F%ometime%G one Fal+a*%G
"'tionalit* indicator
,ach ,ach,ntit* ,ntit*Q Q o'tionalit* o'tionalit* relation%hi' relation%hi' cardinalit* cardinalit* ,ntit* ,ntit*,ach C#/ "M,! %ometime% 'lace% one or more "!D,!. ,ach "!D,! al+a*% i% 'laced $* one C#/ "M,!.
! Minder Chen, 1993~2002 Data Modeling - 3D -
Defining Relationships
" Name " De%cri'tion " Pro'ert*
# Cardinalit* &olume% # "'tionalit* 'ercentage2 P o) ,ntit* *'e QE% in%tance% 'airing +ith ,ntit* *'eE% -E% in%tance% # ran%)era$ilit*2 . relation%hi' i% tran%)era$le i) an entit* in%tance can change it% 'airing +ithin the %ame relation%hi'.
* !.N/5,!.4(,2 .n ,MP("-,, can change to a di))erent D,P.! M,N . * N"N- !.N/5,!.4(,2 .n "!D,! cannot $e tran%)erred to another C#/ "M,!.
! Minder Chen, 1993~2002 Data Modeling - 39 -
Product
&b' mployee
wor$s-%or
&c'
is-consists-o%
Part
contained-in
Data Modeling - @0 -
Data Modeling - @1 -
dentifying Relationships
" .%%ociation $et+een entit* t*'e% " ,ntit* t*'e% that are u%ed on the %ame )orm% or document%. " . de%cri'tion in a $u%ine%% document that ha% a &er$ that relate% t+o entit* t*'e%
# ha% # con%i%t% o) # u%e%
! Minder Chen, 1993~2002 Data Modeling - @2 -
Attributes
" De)inition
# Characteri%tic% that could $e u%ed to de%cri$e ,ntit* *'e% and !elation%hi' *'e%. 0o+e&er, in I,, relation%hi' t*'e% are not allo+ed to ha&e attri$ute%.
,ntit* *'e Name FRuali)ier%G Domain Name Cu%tomer Name ,m'lo*ee /tarting Date " ,6am'le%
# # # # Cu%tomer ha% cu%tomer name, addre%%, and tele'hone num$er Product ha% Huantit*-on-hand, +eight, &olume, color, and name. ,m'lo*ee ha% //N, %alar*, and $irthda*. ,m'lo*ee-+or?%-)or-'ro1ect ha% 'ercentage-o)-time, %tarting-date.
Data Modeling - @3 -
Attributes: 5otations
Student Student () Student *ame
Employee Employee number First name Last name Employee function Employee salary
/tudentF/tudent /tudentF/tudent ID, ID, /tudent /tudent Name, Name, 4irth 4irth DateG DateG
5inding 5inding.ttri$ute%2 .ttri$ute%2 .ttri$ute% .ttri$ute%are areidenti)ied identi)ied'rogre%%i&el* 'rogre%%i&el*during during 4.. 4.. 'ha%e. 'ha%e. "" Data Data.nal*%i% .nal*%i% "" .cti&it* .cti&it*.nal*%i% .nal*%i% "" Interaction Interaction.nal*%i% .nal*%i% "" Current Current /*%tem% /*%tem% .nal*%i% .nal*%i%
! Minder Chen, 1993~2002 Data Modeling - @@ -
Attribute @alue
" De)inition
# .ttri$ute 9alue% are in%tance% o) .ttri$ute% u%ed to de%cri$e %'eci)ic ,ntit* In%tance%
" ,6am'le%
# # # # # Cu%tomer Num$er2 01133@ Cu%tomer Name2 Minder Chen /tate2 9. "rder otal2 S23,000 /ale ta62 S2B0
" .n attri$ute o) an entit* t*'e %hould ha&e onl* one &alue at an* gi&en time. FNo re'eating grou'G " .&oid u%ing com'le6 coding %cheme )or an attri$ute. 5or e6am'le2 P.! Num$er2 Q-QQQ-QQQ
Part *'e
! Minder Chen, 1993~2002
Material
/eHuence Num$er
Data Modeling - @B -
Type 9 nstance
"4=,C -P, ,ntit* *'e ,ntit* ,ntit* *'e !elation%hi' F *'eG .ttri$ute F *'eG "CC#!!,NC, ,ntit* In%tance ,ntit* In%tance ,ntit* Pairing F!elation%hi' In%tanceG F.ttri$uteG 9alue
Data Modeling - @C -
" Deri&ed
# De)inition2 he .ttri$ute 9alue can $e calculated or deduced )rom relation%hi' :rou'ing% or )rom the &alue% o) other .ttri$ute%. he &alue o) a Deri&ed .ttri$ute change% con%tantl*. # ,6am'le%2 /tudent .ge, .ccount 4alance, Num$er o) cour%e% ta?en.
" De%igned
# De)inition2 he .ttri$ute i% created to o&ercome the %*%tem con%traint%. he &alue o) a De%igned .ttri$ute doe% not change. # ,6am'le%2 /tudent ID, Cour%e num$er.
! Minder Chen, 1993~2002 Data Modeling - @A -
Data Types
Data Modeling - @D -
)roperties of Attributes
" " " " " " " Name De%cri'tion .ttri$ute /ource Categor*2 4a%ic, Deri&ed, De%igned Domain or data t*'e2 e6t, Num$er, Date, ime, ime%tam' "'tionalit*2 Mandator* or o'tional (ength and<or 'reci%ion Permitted 9alue% F(egal 9alue%G
# # !ange% . %et o) &alue% FCode a$leG
" De)ault &alue or algorithm ool% %uch a% Po+er4uilder ha% additional 'ro'ertie% )or ta$leN% column% called e6tended attri$ute%
# 9alidation !ule # ,diting 5ormat # !e'orting 5ormat
# Column 0eading # 5orm (a$el # Code a$le
Data Modeling - @9 -
Co$posite Attribute
" De)inition2 " ,6am'le2
# ele'hone Num$er I
.rea code M ,6change M ,6ten%ion " here i% no %u''ort o) com'o%ite attri$ute t*'e mo%t o) C./, tool%. In %uch ca%e, an com'o%ite attri$ute mu%t $e %tored a% an entit* t*'e.
Data Modeling - B0 -
Do$ain
" . collection o) &alue% +hich can $e ta?en $* one or more attri$ute%. " Date i% the domain )or "rdered Date, /tudentE% 4irthda*, ,m'lo*ee /tarting Date. " . u%ed de)ined domain can ha&e custo$i4ed ,alidation rules and for$ats. " C./, tool% %uch a% I,5 onl* %u''ort% the )ollo+ing $a%ic domain%2
# e6t # Num$er # Date # ime # ime%tam'
! Minder Chen, 1993~2002 Data Modeling - B1 -
dentifiers " he identi)ier o) an entit* t*'e i% a %et o) attri$ute% and<or relation%hi'% +ho%e &alue% can uniHuel* identi)* an entit*. " ,ntit* t*'e% %hould ha&e one identi)ier. " Identi)ier% ma* con%i%t o)
# . %ingle attri$ute2 /tudent ID # . %et o) attri$ute%2 /tudent% ID M Cour%e ID # .n attri$ute and a relation%hi' mem$er%hi' Fim'lemented a% a )oreign >e*G2 "rder Item No M "rder 0a% "rder Item
Data Modeling - B2 -
dentifying Relationship
cu%tomer
'lace%
'roduct
/*m$ol )or Identi)*ing !elation%hi'
i% ordered $*
"!D,!/
i% 'laced $* contain% ha%
order
i% 'art o)
order item
Data Modeling - B3 -
T=ac? /mith catche% a cold and +hat he %u%'ect% i% a )lu &iru%. 0e ma?e% an a''ointment +ith hi% )amil* doctor +ho con)irm hi% diagno%i%. he doctor 're%cri$e% an anti$iotic and na%al deconge%tant ta$let%. =ac? lea&e% the doctorE% o))ice and dri&e% to hi% local drug %tore. he 'harmaci%t 'ac?age% the medication and t*'e% the la$el% )or 'ill $ottle%. he la$el include% in)ormation a$out cu%tomer, the doctor +ho 're%cri$e the drug, the drug Fe.g., PenicillinG, +hen to ta?e it, and ho+ o)ten, the content o) the 'ill F2B0 mgG, the num$er o) re)ill%, e6'iration date, and the date o) 'urcha%e.T
Plea%e de&elo' a data model )or the entitie% and relation%hi'% +ithin the conte6t o) 'harmac*. .l%o de&elo' a de)inition )or T're%cri'tionT. (i%t all *our underl*ing a%%um'tion% u%ed in *our data model%.
Data Modeling - B@ -
4urger ;orld Di%tri$ution Center %er&e% a% a %u''lier to @B 4urger ;orld )ranchi%e%. -ou are in&ol&ed +ith a 'ro1ect to $uild a data$a%e %*%tem )or di%tri$ution. ,ach )ranchi%e %u$mit% a da*-$*-da* 'ro1ection o) %ale% )or each o) 4urger ;orldE% menu 'roduct% - the 'roduct% li%ted on the menu at each re%taurant - )or the coming month. .ll menu 'roduct reHuire ingredient% and<or 'ac?aging item%. 4a%ed on 'ro1ected %ale% )or the %tore, the %*%tem mu%t generate a da*-$*-da* and ingredient% need and then colla'%e tho%e need% into one-'er-+ee? 'urcha%e reHui%ition% and %hi'ment%.
Data Modeling - BB -
" 5ind<Create identi)ier% )or each entit* t*'e " .dd attri$ute% to the entit* t*'e in the data model " .nal*8e and re&i%e the data model
Data Modeling - BC -
Characteristics of )artitioning
" "'tionalit*2
# Mandator*2 ,&er* ,ntit* in%tance% o) the ,ntit* *'e mu%t )all into one o) the /u$t*'e categorie%. # "'tional2 Not e&er* ,ntit* in%tance% o) the ,ntit* *'e mu%t )all into one o) the /u$t*'e categorie%.
" ,ntit* (i)e C*cle2 he %tate% through +hich an ,ntit* *'e can 'a%% are u%ed )or Partitioning. " ,numeration2
# 5ull* enumerated # Not )ull* enumerated
,m'lo*ee
*'e
(ecturer /ta))
eache%
/eminar
/tatu%
;age 0ourl*
! Minder Chen, 1993~2002 Data Modeling - B9 -
Po+erDe%igner
,ccount ,ccount %umber %ame
em'lo*ee t*'e
Savings +ate
Checking Fees
Data Modeling - C0 -
Data Modeling - C1 -
5or$ali4ation
" . data $a%e i% a model or an image o) the realit*. " (ogical Data 4a%e De%ign i% a 'roce%% o) modeling and ca'turing the end-u%er &ie+% o) an a''lication domain and %*nthe%i% them into a data $a%e %tructure. " Normali8ation i% a logical data $a%e de%ign method. " he $a%i% )or normali8ation i% the )unctional de'endencie% among attri$ute% in a ta$le.
Data Modeling - C2 -
*Q+ Ter$inology
Product Product /able /able
p,no product,name -uantity price Row !.! ".! "." Color /0 B34 /0 PC "1 !. 2 2.. "2. "... Column
C!,. , .4(,/ F'Uno C0.!FBG N" N#((, 'roductUname C0.!F20G, Huantit* /M.((IN , 'rice D,CIM.(F10, 2GGL
! Minder Chen, 1993~2002 Data Modeling - C3 -
*Q+ Ter$inology
/et heor* !elational D4 a$le Column !o+ Pool o) legal &alue% 5ile 5ile Data item !ecord Data t*'e ,6am'le ProductUta$le ProductUname ProductU101E% in)o. D. , !elation .ttri$ute u'le Domain
Data Modeling - C@ -
*Q+ )rinciples
" " " " " " " he re%ult o) a /R( Huer* i% al+a*% a ta$le F9ie+ or D*namic a$leG !o+% in a ta$le are con%idered to $e unordered Dominate the mar?et% %ince late 19D0% Can $e u%ed in interacti&e 'rogramming en&ironment% Pro&ide $oth data de)inition language FDD(G and data mani'ulation language FDM(G . non-'rocedural language Can $e em$edded in 3:(2
# ,m$edded /R( # D*namic /R(
! Minder Chen, 1993~2002 Data Modeling - CB -
.( ,!
.4(,
Data Modeling - CC -
*Q+: ntroduction
" . relational data $a%e i% 'ercei&ed $* it% u%er% a% a collection o) ta$le% " ,. 5. Codd 19C9 " Dominate the mar?et% %ince late 19D0% " /trength%2
# /im'licit* # ,nd-u%er orientation # /tandardi8ation # 9alue-$a%ed in%tead o) 'ointer-$a%ed # ,ndor%ed $* ma1or com'uter com'anie%
" Mo%t C./, 'roduct% %u''ort the de&elo'ment o) relational data $a%e centered a''lication%
! Minder Chen, 1993~2002 Data Modeling - CA -
/he /he 7eneric 7eneric 8orm 8orm o% o% the the S S L L C/ C/ Statement Statement /,(,C /,(,C VDI/ VDI/ INC INC WWcolumnF%G columnF%G 5!"M 5!"M ta$leF%G ta$leF%G V;0,!, V;0,!,condition%W condition%W V:!"#P V:!"#P44- columnF%G columnF%G V0.9IN: V0.9IN: conditionWW conditionWW V"!D,! V"!D,!44- columnF%GW columnF%GW
! Minder Chen, 1993~2002 Data Modeling - CD -
Database Table
" he )ollo+ing code retrie&e% onl* the (a%t Name and the ,m'lo*ee ID +here the ,m'lo*ee ID i% greater than B. he record% are retrie&ed in de%cending order. /,(,C (a%tName, ,m'lo*eeID 5!"M ,m'lo*ee% ;0,!, ,m'lo*eeID J B "!D,! 4- ,m'lo*eeID D,/C
Data Modeling - C9 -
-/ERE Clause
" ;0,!,2 #%e the ;here clau%e to limit the %election. he O %*m$ol indicate% literal date &alue%. /,(,C X 5!"M ,m'lo*ee% ;0,!, (a%tName I T/mithT /,(,C ,m'lo*ee%.(a%tName 5!"M ,m'lo*ee% ;0,!, ,m'lo*ee%./tate in FEN-E,E;.EG /,(,C "rderID 5!"M "rder% ;0,!, "rderDate 4, ;,,N O01<01<93O .ND O01<31<93O
Data Modeling - A0 -
Deys
" . ?e*, al%o called identi)ier, i% an .ttri$ute or a Com'o%ite .ttri$ute that can $e u%ed to uniHuel* identi)* an in%tance o) an entit* t*'e. " ,6am'le%2 ,ntit* *'e >e*
;arehou%e Product /tudent /hi' /toc? o) Product ;arehou%e Num$er Product Num$er /tudent ID or //N Name and Port o) !egi%tration Product Num$er and ;arehou%e No.
Data Modeling - A1 -
Types of Dey
" Primar* >e*2 . uniHue ?e* i% an attri$ute or a %et o) attri$ute% that ha% $een u%ed $* the D4M/ a% the identi)ier o) a ta$le. " Candidate F.lternati&eG >e*2 .n attri$ute or a %et o) attri$ute% that could ha&e $een u%ed a% the 'rimar* ?e* o) a ta$le. " /econdar* FInde6G >e*2 .n attri$ute or a %et o) attri$ute% that ha% $een u%ed to con%truct the data retrie&al inde6. " Concatenated FCom$ined or Com'o%iteG >e*2 . %et o) attri$ute% that ha% $een u%ed a% the ?e*. " 5oreign >e*2 .n attri$ute or a %et o) attri$ute% that i% u%ed a% the 'rimar* ?e* in another ta$le.
! Minder Chen, 1993~2002 Data Modeling - A2 -
)urposes of 5or$ali4ation
" .&oid maintenance 'ro$lem% %uch a% #'date . " In%ert2 here ma* $e no 'lace to in%ert ne+ in)ormation. " Delete2 /ome im'ortant in)ormation +ill $e lo%t $* deletion. " #'date2 Incon%i%tenc* ma* occur $ecau%e o) the e6i%tence o) data redundanc*. " Pro&ide ma6imum )le6i$ilit* to meet )uture in)ormation need% $* ?ee'ing ta$le% corre%'onding to o$1ect t*'e% in their %im'li)ied )orm%.
! Minder Chen, 1993~2002 Data Modeling - A3 -
" DonEt ru%h to 'ut all the in)ormation in one ta$le. " Create a ta$le to corre%'ond to a cla%% o) a %im'le o$1ect t*'e that %hould e6i%t $* it%el), i.e., Tone )act in one 'lace.T " Include common )ield% Flin?%G a% +a*% o) 1oining in)ormation )rom %e&eral related ta$le%. " .&oid redundanc* $* u%ing lin?% to retrie&e data )rom related ta$le%.
Data Modeling - A@ -
5or$ali4ation Theory
" Normali8ation i% a 'roce%% o) %*%tematicall* $rea?ing a com'le6 ta$le into %im'ler one%. " It i% $uilt around the conce't o) normal )orm%. " . relation i% in a 'articular normal )orm i) it %ati%)ie% a %'eci)ic %et o) con%traint% %uch a% de'endencie% among attri$ute% in the relation. " 5or 6 i% an integer and 6 J 1, i) a relation i% in 6-N5 than it i% in F6-1G-N5. " 0igher order normal )orm% are u%uall* more de%ira$le than lo+er order normal )orm%. " Normali8ation 'roce%% u%uall* %tart% )rom com'le6 relation% +hich are u%uall* dra+n )rom %ome e6i%ting document% %uch a% $u%ine%% )orm%.
! Minder Chen, 1993~2002 Data Modeling - AB -
A 'usiness !or$
Data Modeling - AC -
*olution
#nnormali8ed ta$le
!emo&e re'eating grou'
&Order*o9 Order)ate9 Cust*o9 CustAddress9 Cust/ype9 /a:9 !;Product*o9 )escription9 5uantity9 6nitPrice9Subtotal<
!emo&e 'artial 5D
2nd N5
!emo&e tran%iti&e 5D
3rd N5
! Minder Chen, 1993~2002
&nnor$ali4ed !or$
" . relation that ha% multi-&alued attri$ute% Fre'eating grou'%G. " Normali8ation Proce%%2 !emo&e Multi-&alue .ttri$ute% " I) an unnormali8ed relation ! ha% a 'rimar* ?e* > and a multi-&alue attri$ute M, the normali8ation 'roce%% i%2
" ,6am'le2 .n ,m'lo*ee relation ha% an attri$ute language%'o?en. 5or %ome em'lo*ee% there ma* $e more than one language that the* can %'ea?.
,MP Fem'lo*eeID, em'Name, em'.ddre%%, Flanguage1, language2, ...GG ,MP Fem'lo*eeID, em'Name, em'.ddre%%G ,MP-(.N:#.:, Fem'lo*eeID, language, %?ill(e&elG
! Minder Chen, 1993~2002 Data Modeling - A9 -
# he multi-&alue attri$ute M %hould $e remo&ed )rom !. # . ne+ relation +ill $e created +ith F>,MG a% the 'rimar* ?e* o) the relation. # here ma* $e %ome other attri$ute% a%%ociated +ith thi% ne+ relation. # ! +ill then $e at lea%t in 1N5.
Data Modeling - D0 -
!unctional Dependency
" Notation2 !.Q IJ !." De)inition2 .ttri$ute - o) !elation ! i% )unctionall* de'endent on the .ttri$ute Q o) !elation ! +hen there i% each &alue o) !.- a%%ociated +ith no more than one &alue o) !.Q. !.Q and !.- ma* $e com'o%ite attri$ute%. " De%cri'tion2
# ! .- i% )unctionall* de'endent on !.Q # !.Q )unctionall* determine% !.! Minder Chen, 1993~2002 Data Modeling - D1 -
" !.. IJ !.4 " I) 4 i% not )unctionall* de'endent on an* %u$%et o) . Fother than . it%el)G, 4 i% )ull* de'endent on . in !. " I) 4 i% )unctionall* de'endent on a %u$%et o) . Fother than . it%el)G, 4 i% 'artiall* de'endent on . in !.
Data Modeling - D2 -
" ,6am'le
# /u''lier-Part relation ha% attri$ute% %u''lierO, 'artO, Ht*, cit*, di%tance, +here F%u''lierO, 'artOG i% the ?e*. # Cit* i% 'artiall* de'endent on %u''lierO.
/#PP(I,!-P.! F%u''lierO, 'artO, Ht*, cit*, di%tanceG /#PP(I,!-P.! F%u''lierO, PartO, Ht*G /#PP(I,! F%u''lierO, cit*, di%tanceG
! Minder Chen, 1993~2002 Data Modeling - D3 -
5on-loss Deco$position
" Normali8ation i% a reduction Fdecom'o%itionG 'roce%% that re'lace% a relation $* %uita$le 'ro1ection%. ,ach o) the 'ro1ection i% a ne+ relation that i% in a )urther normali8ed )orm than the original relation. he collection o) 'ro1ection% i% eHui&alent to the original relation. " he original relation can al+a*% $e reco&ered $* ta?ing the natural 1oin o) the%e 'ro1ection%. " .n* in)ormation that can $e deri&ed )rom the original relation can al%o $e deri&ed )rom the )urther normali8ed relation%. he con&er%e i% not true. " he 'roce%% i% re&er%i$le $ecau%e no in)ormation i% lo%% in the reduction 'roce%%.
Data Modeling - D@ -
Transiti,e Dependency
In a relation !, i) !.. IJ!.4 and !.4 IJ !.C then attri$ute C i% %aid to $e tran%iti&el* de'endent on attri$ute ..
Data Modeling - DB -
/#PP(I,! F%u''lierO, cit*, di%tance, Hualit*Ule&elG /#PP(I,! F/u''lierO, cit*, Hualit*Ule&elG CI --DI/ .NC, Fcit*, di%tanceG
! Minder Chen, 1993~2002 Data Modeling - DC -
,6'lanation ,6'lanation " .ll the non-?e* attri$ute% ha&e atomic &alue and de'endent on the ?e* F1N5 - No multi-&alue attri$uteG, " the +hole ?e*, F2N5 - No Partiall* 5unctional De'endenc*G " and nothing $ut the ?e* F3N5 - No ran%iti&e 5unctional De'endenc*G
! Minder Chen, 1993~2002 Data Modeling - DA -
5or$ali4ation )rocess
#nnormali8ed #nnormali8ed5orm 5orm
A
!*8 !*8
=
"*8 "*8
7 8
>*8 >*8
>*8 >*8
) B C )
Data Modeling - DD -
" Con%
# Man* com'le6 Huerie% +ill $e %lo+er $ecau%e 1oin% ha&e to $e 'er)ormed to retrie&e rele&ant data )rom %e&eral normali8ed ta$le% # Programmer%<u%er% ha&e to under%tand the underl*ing data model o) an data$a%e a''lication in order to 'er)orm 'ro'er 1oin% among %e&eral ta$le% # he )ormulation o) multi'le-le&el Huerie% i% a nontri&ial ta%?.
Data Modeling - D9 -
Data Modeling - 90 -
(D
(D
(D
Data Modeling - 91 -
.oin Tables
/,(,C "rder%."rderID, "rder%.Cu%tID, (a%tName, 5ir%tname, "rder%.ItemID, De%cri'tion 5!"M Cu%tomer, "rder%, In&entor* ;0,!, Cu%tomer.Cu%tID I "rder%.Cu%tID .ND "rder%.ItemID I In&entor*.ItemID "!D,! 4- Cu%tID, "rder%.ItemID
(D
(D
Data Modeling - 92 -
Data Modeling - 93 -
Denor$ali4ation
" he 'roce%% o) intentionall* $ac?ing a+a* )rom normali8ation to im'ro&e 'er)ormance. Denormali8ation %hould not $e the )ir%t choice )or im'ro&ing 'er)ormance and %hould onl* $e u%ed )or )ine tuning a data$a%e )or a 'articular a''lication. " !eHuirement%
# Prior normali8ation # >no+ledge o) data u%age
" 4ene)it%
# # # # # # # # # Minimi8e the need )or 1oin% !educe num$er o) ta$le% !educe num$er o) )oreign ?e*% !educe num$er o) indice% 0o+ o)ten are t+o data item% needed together 0o+ man* ro+% are in&ol&ed 0o+ &olatile i% denormali8ed data 0o+ im'ortant i% &i%i$ilit* o) data to u%er% ;hat i% the minimum re%'on%e time and )reHuenc* o) an Huer*
Data Modeling - 9B -
De-nor$ali4ation: An E;a$ple
!1
="IN
!2
Denormali8ation
!1 X ! 2
" ;here2
!2
# !1 FProductNo, /u''lierNo, PriceG # !2 F/u''lierNo, Name, .ddre%%, PhoneG # !1X!2 FProductNo, /u''lierNo, Name, .ddre%%, Phone, PriceG
" !2 %hould $e ?e't to 're&ent data lo%%. " Data redundanc* in !1X!2 and !2 could cau%e 'otential data incon%i%tenc* 'ro$lem% i) the redundant data in the%e t+o ta$le% are not maintained 'ro'erl*.
Data Modeling - 9C -
Data Modeling - 9A -
I%olated ,ntit* *'e /olitar* ,ntit* *'e "ne-to-"ne !elation%hi' !edundant !elation%hi' Multi-9alued .ttri$ute% .ttri$ute +ith .ttri$ute% Man*-to-Man* !elation%hi'
Data Modeling - 9D -
Data Modeling - 99 -
Correct Correct
Purchase Order
Redundant Relationship
I% thi% relation%hi' redundantK ha% ordered
cu%tomer
'lace%
'roduct
i% ordered $*
"!D,!/
i% 'laced $* contain% ha%
order
i% 'art o)
order item
Redundant Relationship
!edundant !edundant Product i% held a% /toc? contain% Non-redundant Non-redundant i% contained in Product contain% i% held in %toc?% ;arehou%e hold%
"rder (ine
i% contained in contain%
"rder
"rder 0i%tor*
Multi-@alued Attribute
" De)inition
# .n .ttri$ute that ma* ha&e more than one &alue at a time i% called a multi&alued attri$ute. Create an ,ntit* *'e )or the multi-&alued attri$ute (anguage% %'o?en $* an ,m'lo*ee ,m'lo*eeFID, Name, Phone, (anguage%G ,m'lo*eeF111, Z=ohn /mith[, 201-999-DDDD, F,ngli%h, Chine%eGG
" /olution2
# # # #
" ,6am'le2
# # # # #
,m'lo*eeFID, Name, PhoneG ,m'lo*eeF111, Z=ohn /mith[, 210-999-DDDDG ,m'lo*eeUlanguageFID, (anguageG ,m'lo*eeUlanguageF111, ,ngli%hG ,m'lo*eeUlanguageF111, Chine%eG
Data Modeling - 10@ -
" /olution2
# Create an ,ntit* *'e to a&oid an .ttri$ute +ith .ttri$ute%. # .dd ne+ attri$ute% to the e6i%ting ,ntit* *'e.
! Minder Chen, 1993~2002 Data Modeling - 10B -
;h*K ;h*K
here i% no 'lace to attach .ttri$ute% that are reHuired to de%cri$e a man*-to-man* !elation%hi'. " It i% di))icult to tran%late man*-to-man* !elation%hi'% into relational ta$le% automaticall*. "
one-to-man* !elation%hi'% $* creating an Associati,e Entity Type $et+een the e6i%ting t+o ,ntit* *'e%.
"rder
contain% $elong% to ha%
"rder (ine
i% contained in
Product
F$G /tudent
ta?e% i%-ta?en-$*
Cour%e
FcG
con%i%t%-o)
Part
i%-contained-in
Data Modeling - 10D -
'ills of Material
Part con%i%t%-o) i%-a-com'onent-in 4 . C
2
,
1
5
Product /tructure
4 C D , D 5
2 1 1 3 2 2
Data Modeling - 109 -
Product Product#%age #%agei% i%an an.%%ociati&e .%%ociati&e,ntit* ,ntit* *'e *'e)or )ora a3-ar* 3-ar*!elation%hi'. !elation%hi'.
u%e%
Pro1ect
%u''lie% /u''lier
! Minder Chen, 1993~2002 Data Modeling - 110 -
"rder (ine
i% contained in
Product
N" N#((,
"
he entire, or 'art o), a data Fentit*-relation%hi'G model can $e tran%lated into a normali8ed data$a%e de%ign.
/euristics of Transfor$ation
" . ta$le i% created )or each ,ntit* *'e in the ,! diagram. " . ta$le i% created )or each multi-&alued attri$ute. " !elation%hi' *'e% are im'lemented a% ta$le% or a% )oreign ?e*% in other ta$le%. " Man*-to-man* relation%hi' t*'e% are tran%lated into ta$le%. " 5oreign ?e*% are u%ed )or im'lementing one-to-one and one-toman* !elation%hi' *'e%. " 5or one-to-man* !elation%hi' *'e%, the )oreign ?e* i% 'laced in the ta$le that re're%ent% the ,ntit* *'e on the Tman*T end o) the !elation%hi' *'e. " 5or identifying one-to-man* !elation%hi' *'e%, the P> o) the ToneT ta$le migrate to the Tman*T ta$le a% a 5> and the 5> i% al%o 'art o) the P> o) the Tman*T ta$le. " 5or non-identifying one-to-man* !elation%hi' *'e%, the P> o) the ToneT ta$le migrate to the Tman*T ta$le a% a 5> and the 5> i% a non-?e* attri$ute o) the Tman*T ta$le.
Data Modeling - 113 -
htt'2<<+++.'o+er%o)t.com<
Data Modeling - 11@ -
arget D4M/
! Minder Chen, 1993~2002
)owerDesigner
Conce'tual Data Model Pro1ect 2 Management Model 2 Pro1ect Management .uthor 2 #%er 9er%ion C.6 A<21<9D
Cu%tomer Cu%tomer num$er Cu%tomer name Cu%tomer addre%% Cu%tomer acti&it* Cu%tomer tele'hone Cu%tomer )a6
I% mem$er o) %u'er&i%e% ,m'lo*ee ,m'lo*ee num$er 5ir%t name (a%t name ,m'lo*ee )unction ,m'lo*ee %alar* I% manager o)
#%e%
/u$contract
Material Material num$er Material name Material t*'e Partici'ate /tart date ,nd date
com'o%e%
com'o%ed o)
5otations
Employee Employee number First name Last name Employee function Employee salary
,nt it*
!elation%hi'
Employee Employee number First name Last name Employee function Employee salary
"ne-to-man*
! Minder Chen, 1993~2002 Data Modeling - 11A -
More on Relationships
,m'lo*ee ,m'lo*ee num$er 5ir%t name (a%t name ,m'lo*ee )unction ,m'lo*ee %alar* i% a mem$er o) eam mem$er
Man*-to-man* cardinalit*
. 'ro1ect Econtain%N one or more ta%?%, and a ta%?E% e6i%tence i% dependent on the 'ro1ect.
Ad,anced Concepts
Material Material num$er Material name Material t*'e
com'o%e% com'o%ed o)
/a&ing% !ate
Chec?ing 5ee% ,m'lo*ee ,m'lo*ee num$er 5ir%t name (a%t name ,m'lo*ee )unction ,m'lo*ee %alar*
/u$t*'e
!e)le6i&e relation%hi'
Data Modeling - 119 -
Define Entities
Define Attributes
Chec( )ara$eters
Relationship Definition
,m'lo*ee ,m'lo*ee num$er 5ir%t name (a%t name ,m'lo*ee )unction ,m'lo*ee %alar*
ran%)ormation
DI9N#M I DI9N#M
Dependent Relationship
Conce'tual Conce'tual Data DataModel Model
ran%)ormation
P!"=,C P!"N#M \'?J C#/N#M \)?J ,MPN#M \)?J .C 4,: .C ,ND P!"N.M, P!"(.4(
P!"N#M I P!"N#M
Ph*%ical Data Model Pro1ect2Management Model 2 Pro1ect Management .uthor 2#%er 9er%ionC.6 A<21<9D
,.N#M I ,.N#M
,MP("-,UM. ,!I.( M. ,!I.(.M. N.M, charF30G P!"=.,MP("-,,.,MPN#M numericFBG P!"=.,MP("-,,.,MP5N.M charF30G P!"=.,MP("-,,.,MP(N.M charF30G P!"=.,MP("-,,.,MP5#NC charF30G M. ,!I.( P!"=.,MP("-,, #/,D
C#/N#M I C#/N#M
,MPN#M I ,MPU,MPN#M
,MP("-,, ,MPN#M \'?J ,MPU,MPN#M \)?J DI9N#M \)?J ,MP5N.M \a?J ,MP(N.M \a?J ,MP5#NC \a?J ,MP/.(
,MPN#M I ,MPN#M
P!"=,C P!"N#M \'?J C#/N#M \)?J ,MPN#M \)?J .C 4,: .C ,ND P!"N.M, P!"(.4(
,MPN#M I ,MPN#M
P!"N#M I P!"N#M
P.! ICIP. , P!"N#M \'?,)?J />N.M, \'?,)?J ,MPN#M \'?,)?J P.!4,: P.!,ND
Referential ntegrity
" he arro+ i% 'ointing )rom the ta$le containing the )oreign ?e* to the ta$le +here the )oreign ?e* i% u%ed a% a 'rimar* ?e*.
Deletion Rules
" #'date Con%traint% " Delete Con%traint% #None #!e%trict #Ca%cade #/et null #/et De)ault
alter ta$le P!"=.P.! ICIP. , add con%train t 5>UP.! ICIPU;"!>/U"NU,MP("-,, )oreign ?e* F,MPN#MG re)erence% P!"=.,MP("-,, F,MPN#MG < alter ta$le P!"=.P.! ICIP. , add con%train t 5>UP.! ICIPUI/UD"N,U4U ./> )oreign ?e* FP!"N#M, />N.M,G re)erence% P!"=. ./> FP!"N#M, />N.M,G < alter ta$le P!"=.M,M4,! add con%train t 5>UM,M4,!UM,M4,!U ,.M )oreig n ?e* F ,.N#MG re)erence% P!"=. ,.M F ,.N#MG < alter ta$le P!"=.M,M4,! add con%train t 5>UM,M4,!UI/UM,M4,!U,MP("-,, )oreign ?e* F,MPN#MG re)erence% P!"=.,MP("-,, F,MPN#MG < alter ta$le P!"=.#/,D add con%train t 5>U#/,DU#/,DUM. ,!I.( )oreig n ?e* FM. N#MG re)erence% P!"=.M. ,!I.( FM. N#MG < alter ta$le P!"=.#/,D add con%train t 5>U#/,DU#/,/U,MP( "-,, )oreig n ?e* F,MPN#MG re)erence% P!"=.,MP("-,, F,MPN#MG < alter ta$le P!"=.C"MP"/, add con%train t 5>UC"MP"/,UC"MP"/,/UM. ,!I.( )o reign ?e* FCPDUM. N#MG re)erence% P!"=.M. ,!I.( FM. N#MG < alter ta$le P!"=.C"MP"/, add con%train t 5>UC"MP"/,UC"MP"/,DUUM. ,!I.( )oreign ?e* FCPNUM. N#MG re)erence% P!"=.M. ,!I.( FM. N#MG <
Referential ntegrity
alter ta$le P!"=.,MP("-,, add con%traint 5>U,MP("-,,UC0I,5U,MP("-,, )oreign ?e* F,MPU,MPN#MG re)erence% P!"=.,MP("-,, F,MPN#MG < alter ta$le P!"=.,MP("-,, add con%traint 5>U,MP("-,,U4,("N:/U UDI9I/I"N )oreign ?e* FDI9N#MG re)erence% .DMIN.DI9I/I"N FDI9N#MG < alter ta$le P!"=.P!"=,C add con%traint 5>UP!"=,C U/#4C"N !.UC#/ "M,! )oreign ?e* FC#/N#MG re)erence% P!"=.C#/ "M,! FC#/N#MG < alter ta$le P!"=.P!"=,C add con%traint 5>UP!"=,C UI/U!,/P"NU,MP("-,, )oreign ?e* F,MPN#MG re)erence% P!"=.,MP("-,, F,MPN#MG < alter ta$le P!"=. ./> add con%traint 5>U ./>U4,("N:/U UP!"=,C )oreign ?e* FP!"N#MG re)erence% P!"=.P!"=,C FP!"N#MG <
Mani'ulate a$le%2
" Colla'%e ta$le% " /u'ert*'e% 3 %u$t*'e%
.dd a$le%2
" Deri&ed data ta$le%
/ource2 :illete, !o$, etc., )hysical Database Design for *ybase *Q+ *er,er, Prentice 0all, 199B.
Controlling .cce%%
Manage "$1ect%2
" /i8e% " Placement Data Modeling - 13B -
Deri&ed
Detailed Pa%t
In)ormational Data$a%e
Pro1ecte Current d
" Data e6traction " Data )iltering " a$le 1oining " ran%lation " !e-5ormatting
"'erational Data$a%e
Current &alue .''lication $* a''lication D*namic 5ull* normali8ed )or tran%action 'roce%%ing 0igh #'dated on a record and )ield $a%i% 0ighl* %tructured tran%action 'roce%%ing /u$-%econd to 2-3 %econd%
In)ormational Data$a%e
.rchi&al data, %ummari8ed data, calculated data /u$1ect area% acro%% enter'ri%e /tatic until re)re%hed =oined &ie+% %uita$le )or $u%ine%% anal*%i% (o+ - Medium .cce%% onl*L no direct u'date 0ighl* un%tructured, heuri%tic or anal*tical 'roce%%ing /e&eral %econd% to minute%
Data Modeling - 13A -
!elational 9ie+
Multidimen%ional 9ie+
! Minder Chen, 1993~2002 Data Modeling - 13D -
Di$ensional Model
Product
" " " " " >e* Name De%cri'tion /i8e Price
Mar?et !egion
" " " " " >e* De%cri'tion Di%trict !egion Demogra'hic%
Promotion
" " " " >e* De%cri'tion Di%count Media
ime
" " " " >e* ;ee?da* 0olida* 5i%cal
!egion
Product
ime
" ;h*K
# .n "( P F"n-(ine ran%action Proce%%G de%ign o) an order 'roce%%ing %*%tem ma* ha&e do8en% or hundred% o) ta$le%. It $ecome% di))icult )or $u%ine%% manager% to under%tand the de%ign in order to anal*8e the data.
! Minder Chen, 1993~2002 Data Modeling - 1@0 -
Product Product identifier 3pk4 &rand identifier 3fk4 Product description Product category Product unit price
Customer Customer identifier 3pk4 Customer name Customer address Customer activity Customer phone number Customer fa number
int char5678 char5978 char5978 char5:;8 char5:;8 1ear identifier 1ear name 1ear 3pk4 int char5678
Customer identifier 0 Customer identifier Product identifier 0 Product identifier 1ear identifier 0 1ear identifier
Sale Time identifier Customer identifier Store identifier Product identifier Sale total Sale revenu 3fk4 3fk4 3fk4 3fk4 int int int int real real
2uarter 2uarter identifier 3pk4 int 1ear identifier 3fk4 int 2uarter name char5:78
2uarter identifier 0 2uarter identifier
-onth -onth identifier 3pk4 int 2uarter identifier 3fk4 int -onth name char5:78
-onth identifier 0 -onth identifier
+egion +egion identifier 3pk4 int Country identifier 3fk4 int +egion name char5678
+egion identifier 0 +egion identifier
)eek )eek identifier 3pk4 int -onth identifier 3fk4 int )eek name char5678 )eek number in year int
)eek identifier 0 )eek identifier
Store Store identifier +egion identifier Store name Store address Store manager Store phone number Store F,= number Store financial services type Store photo services type
3pk4 int 3fk4 int char5<78 char5978 char5678 char5;78 char5;78 char5:78 char5:78
Day )eek identifier 3fk4 Time identifier 3pk4 Date Day of >eek Day number in month
dept?id 0 parent?id dept dept?id int parent?id int name varchar5;<<8 description te t date?changed datetime pfid 0 pfid product?variant sku int pfid varchar5678 attribute7 tinyint attribute: tinyint attribute; tinyint attribute6 tinyint attribute@ tinyint
product?family pfid varchar5678 dept?id int manufacturer?id int name varchar5;<<8 short?description varchar5;<<8 long?description te t image?filename varchar5;<<8 intro?date datetime date?changed datetime list?price int monogramable tinyint
pfid 0 pfid
shopper sku 0 sku shopper?id char56;8 order?id 0 order?id created datetime name varchar5;6<8 pass>ord varchar5;78 street varchar5<78 city varchar5<78shopper?id 0 shopper?id state varchar5678 receipt Cip varchar5:<8 order?id char5;A8 country varchar5;78 shopper?id char56;8 phone varchar5:A8 total int email varchar5<78 status tinyint date?entered datetime date?changed datetime marshalled?receipt image shopper?id 0 shopper?id basket shopper?id char56;8 date?changed datetime marshalled?order image
receipt?item pfid varchar5678 sku int order?id char5;A8 ro>?id int Buantity int adjusted?price int promo?price promo?name varchar5;<<8 promo?type int promo?description te t promo?rank int active int date?start datetime date?end datetime shopper?all int shopper?column varchar5A@8 shopper?op varchar5;8 shopper?value varchar5A@8 cond?all int cond?column varchar5A@8 cond?op varchar5;8 cond?value varchar5A@8 cond?basis char5:8 cond?min int a>ard?all int a>ard?column varchar5A@8 a>ard?op varchar5;8 a>ard?value varchar5A@8 a>ard?ma int disjoint?cond?a>ard int disc?type char5:8 disc?value realData Modeling
- 1@C -
.ttri$ute 0 o) ')id 1@ i% %i8e and the attri$ute &alue 1 i% :rande and 2 i% all and 3 i% /hort
http://www.oracle.com/tools/jdeveloper/documents/jsptwp/index.html?content.html