Download - 08 Database Part1 Post
-
7/23/2019 08 Database Part1 Post
1/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
Database Design
MIS 320
Kraig Pencil
Summer 2013
1
-
7/23/2019 08 Database Part1 Post
2/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
Game Plan
Intr!ducti!n
Data base design"Database scenari!
"Key #uesti!ns$ans%ers
2
http://www.youtube.com/watch?v=jyx8iP5tfCIhttp://www.youtube.com/watch?v=jyx8iP5tfCI -
7/23/2019 08 Database Part1 Post
3/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
. Intr!ducti!n
'emember ( )
C**+ Internet is ,T!- inn!ati!n/ ! -ast 2 years 1$1$04
5ut Kraig Pencil says (
T6e relati!nal database is e#ually im-!rtant
'eally) 76y)
T6e Internet %!uld n!t be nearly as successul %it6!ut
relati!nal databases -r!iding ric6 in!rmati!n.
3
http://www.cnn.com/2005/TECH/01/03/cnn25.top25.innovations/index.htmlhttp://www.cnn.com/2005/TECH/01/03/cnn25.top25.innovations/index.html -
7/23/2019 08 Database Part1 Post
4/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
. Intr!ducti!n
8!u can as9 a database #uesti!ns
" :!% many cans ! c6ic9en s!u- d! %e 6ae in inent!ry)
" :!% large is t6e aerage -ay raise in eac6 de-artment)
" 76! are my best$%!rst cust!mers)" 76at else 6ae I;P!d buyers als! -urc6ased)
" Is t6is airline -assenger a 9n!%n terr!rist)
" 76! 6as friendedGayle
-
7/23/2019 08 Database Part1 Post
5/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
. Intr!ducti!n
76! %!r9s %it6 databases)
Database -r!grammers
Database analysts
Database designers
Database administrat!rs
Data administrat!rs
7ebsite designers$-r!grammers
Many n!n;IT users?" Mar9eters
" @inancial analysts
" :uman res!urces managers (. nd m!re
-
7/23/2019 08 Database Part1 Post
6/22
PPT Slides by Dr. Craig Tyran & Kraig Pencil
. Intr!ducti!n1. 76at d!es an !rganiAati!n d! %it6
data$in!rmati!n) Ca-ture= cradle= and -r!cess transacti!n
data$in!rmati!n
e.g.= TPS
Bse in!rmati!n t! ma9e decisi!ns
e.g.= DSS
,ersee/ t6e in!rmati!n e.g.= 76! can ie% !r use %6at in!)= :!% t! bac9
u- in!)= :!% l!ng t! retain in!)
2. 76at can 6el- su--!rt t6e ab!e)
database management system
-
7/23/2019 08 Database Part1 Post
7/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. 5usiness Scenari!
1. Is data management a -r!blem)
@!r generati!ns %e st!red in!rmati!n in iling cabinets= t6enin EFcel s-reads6eets. 5ut as t6e am!unt ! data 6as gr!%n
t6!se met6!ds 6ae bec!me ("Ineicient " and eF-ensie " t! st!re and gat6er data
"Bnable t! su--!rt !r decisi!n ma9ing based!n data
database management system isneeded t! su--!rt business ???
-
7/23/2019 08 Database Part1 Post
8/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. 5usiness Scenari!
1. *!rt6%ind Inc!r-!rated" Distribut!r ! !!d and beerage -r!ducts
" Cust!mers+ 'estaurants and s-ecialty !!d st!res
" Su--liers+ C!me r!m ar!und t6e %!rld
" In t6e lab and lectures= y!u %ill see6!% eiciently a database management system
can -r!ide ric6 in!rmati!n t! t6e!rganiAati!n.
-
7/23/2019 08 Database Part1 Post
9/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
C. Ste-s ! Database Design1. 76at 9inds ! ,t6ings/ d!es an !rganiAati!n
%ant t! c!llect in!rmati!n ab!ut)
Determine t6e Entities
@!r *!rt6%ind Inc= t6e ,entities/ !interest include+
" Cust!mers
" Su--liers
" Em-l!yees
" Pr!ducts
" Etc.
-
7/23/2019 08 Database Part1 Post
10/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
C. Ste-s ! Database Design c!nt.4
2. 76at s-eciic in!rmati!n ab!ut eac6
entity is im-!rtant)
Determine t6e attributes !r eac6 entity
EFam-le+ @!r t6e Em-l!yeeentity=attributes may include
Em-l!yee name
ddress
:!urly rate
Etc.
76! is t6is guy d!ing t6e interie%)
,business analyst/
@!r eac6
em-l!yee= %e
9ee- trac9 ! (
President !
*!rt6%ind
10
-
7/23/2019 08 Database Part1 Post
11/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
C. Ste-s ! Database Design c!nt.4
3. :!% d! %e !rganiAe t6e data) 76ic6 ty-e ! database
,m!del/ s6all %e use)
" ssume+ Bse t6e m!st -!-ular m!del
'elati!nal m!del
,'elati!n/ reers t! )))
Data is !rganiAed as a lin9ed set ! tables
n eFam-le ! a relati!naldatabase
management system t6at y!u are using
in MIS 320 +
11
-
7/23/2019 08 Database Part1 Post
12/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
*!rt6%ind Database in MS ccess
SampleEntity-Relationship Diagram
(aka an ERD or
ER diagram)
-
7/23/2019 08 Database Part1 Post
13/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. Database Huesti!ns c!nt.4>. 76at are t6e im-!rtant as-ects ! a data table)
" Termin!l!gy !r data tables
@ieldi.e. column4
" Attribute! t6e entity 'ec!rdi.e. row4
" n instance! an entity
@ilei.e.= table4
" C!llecti!n ! rec!rds !r an entity
Primary 9ey
" Bni#ue identiier !r eac6 rec!rd
" ten a uni#ue ,ID c!de/ is created
" EFam-le+ See neFt igure
@ind all recordsin t6e
Cust!mer file!r %6ic6
t6e cust!mers name field
is Serena Je%is
13
-
7/23/2019 08 Database Part1 Post
14/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
Database Tables
Supplier ID Company ame Street !ddress City State
1001 CME Inc. 123 Easy St. Deming 7
1002 8< C!r-!rati!n > Ma-le St. 5elling6am 7
1003 Pr!ductC! Inc. 3L Main St. Seattle 7
( ( ( ( (
"roduct ID "roduct ame #nit "rice ($) Supplier ID
00 C6eddar C6eese 1 1001
01 S%iss C6eese 12 1001
02 C6uc9anut 'ed7ine
20 1002
( (. (. (
Su--lier Table
Pr!duct Table
76at are eFam-les ! a4 @ield= b4 'ec!rd= c4 @ile=
and d4 a--r!-riate Primary Key ))
-
7/23/2019 08 Database Part1 Post
15/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
C. Ste-s ! Database Design c!nt.4
. 76at are t6e relati!ns6i-s bet%een t6e entities)" database in!les tables t6at are lin9ed t!get6er
" 76en building a database= %e need t! 9n!% 6!% t! lin9 t6e tables
i.e.= 7e need t! 9n!% 6!% t6e entitiesare related?
e.g.= Supplier-r!ides aProduct." I %e 9n!% %6! t6e su--lier is= %e
can ind all t6e -r!ducts t6ey 6ae
su--lied t! us.
" @!r any -r!duct= %e s6!uld be able
t! ind t6e su--liers address.
" Deel!- a ,blue-rint/ diagram
!r database design
Entity;relati!ns6i- diagram
1
-
7/23/2019 08 Database Part1 Post
16/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. Database Huesti!ns c!nt.4. 76at are t6e relati!ns6i-s bet%een t6e entities) c!nt.4
" P!ssible ,relati!ns6i- ty-es/ 4 !ne t! !ne= 54 !ne t! many= c4 many t! many
" ,!ne/ means ,at m!st !ne/
" ,many/ means ,m!re t6an !ne/
" EFam-le+ Entities+ Su--lier= Pr!duct
76at is t6e relati!ns6i- ty-e) 7e are t!ld t6at+
" su--lier can -r!ide many dierent 9inds ! -r!ducts.
" -r!duct can be su--lied by a maF ! !ne su--lier.
Entity;'elati!ns6i- Diagram+
Su--lier Pr!duct)))))) manyone
Pr!ides1
-
7/23/2019 08 Database Part1 Post
17/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. Database Huesti!ns c!nt.4. 'elati!ns6i- symb!ls+ t6ese all mean t6e same t6ing
T6e teFtb!!9 used ,cr!%s!!t/ symb!ls
ccess uses ,1 " / symb!ls
ccess uses , " / symb!ls
Ign!re t6ese ,inner/ symb!ls
ne Many
-
7/23/2019 08 Database Part1 Post
18/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
5. Database Huesti!ns c!nt.4
. c!nt.4
" @!reign 9ey
Seres as a ,lin9/ bet%een data iles$tables
ield in !ne ile$table t6at seres as a -rimary9ey in an!t6er ile$table
:!% t! determine t6e !reign 9ey)
" @!r a ,!ne t! many/ relati!ns6i-= t6e -rimary 9ey !n t6e
,!ne/ side ! t6e relati!ns6i- is added t! t6e table !n t6e,many/ side
See eFam-les
1
-
7/23/2019 08 Database Part1 Post
19/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
Database Tables+ *!rt6%est Inc.Supplier ID Company ame Street !ddress City State
1001 CME Inc. 123 Easy St. Deming 7
1002 8< C!r-!rati!n > Ma-le St. 5elling6am 7
1003 Pr!ductC! Inc. 3L Main St. Seattle 7
( ( ( ( (
"roduct ID "roduct ame #nit "rice ($) Supplier ID Category ID
00 C6eddar C6eese 1 1001 10
01 S%iss C6eese 12 1001 10
02 C6uc9anut 'ed7ine
20 1002 20
( (. (. ( (
Category ID Category ame Description
10 Dairy C6eese and mil9-r!ducts
20 S-irits 7ine and li#u!rs
( ( (
Su--lier
Table
Pr!ductTable
Categ!ry Table
-
7/23/2019 08 Database Part1 Post
20/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
*!rt6%ind Database in MS ccess+ Primary$@!reign Keys
76ere are t6e -rimary 9eys) T6e !reign 9eys)
-
7/23/2019 08 Database Part1 Post
21/22PPT Slides by Dr. Craig Tyran & Kraig Pencil
C. Ste-s ! Database Design c!nt.4. 76at d! %e d! %it6 t6e entity;
relati!ns6i- diagram) c!nt.4" E'D can be reie%ed %it6 client Is t6e
design c!rrect !r t6e clients needs)4
" Database design can be used t! build t6edatabase
e.g.= 5uild database in MS ccess
" Can database design get m!re c!m-licatedt6an t6is)
8es? 5ut ( t6e -rei!us eFam-le %ill suice!r MIS 320
" T6e lab database -r!Nects %illty-ically !cus !n ,!ne t! many/ty-es ! relati!ns6i-s
21
-
7/23/2019 08 Database Part1 Post
22/22
PPT Slid b D C i T & K i P il
Termin!l!gy Summary
Easy tounderstand
!cademic
Table @ile4 Entity $ 'elati!n
C!lumn @ield ttribute
'!% 'ec!rd Instance
T6e terms in eac6 r!% 6ae ery similarmeanings.
@!r t6is c!urse= learn all ! t6e terms= butd! n!t be c!ncerned ab!ut t6e nuanced
dierences bet%een terms in t6e same r!%.
22