Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
edu/instruction
Database Design
"ables are constructed and associated to each other through shared fields31common2 fields
Practical Database Design for Relational Database A set of attributes com!rises a record Records are alsoManagement 1rows2 or 1tu!les2Systems
4ields are also 1columns2 or 1attributes2
"ables are related through common fields designated as !rimary and foreign keys Allow us to find/ u!date/ and delete data 5uickly/ and hel! to ensure accuracy
$/ % $/ &' 6
4oreign ,ey: 4ields in a table that refer "he normali#ation !rocess and how/why use it to the !rimary key in another table Relating tables
"he data this field must e8actly match data "y!es of in relationshi!s contained in the !rimary key field.
$/ % $/ &' ( 9
www.lib.ku.edu/instruction
What is Normalization?
"he !rocess by which we efficiently organi#e data to achie+e these goals:
7liminating redundancy 7nsuring data is stored in the correct table 7liminating need for restructuring database when data is added.
$/ % $/ &'
www.lib.ku.edu/instruction
()am#le
item "<shirt !olo "<shirt sweatshirt colors red/ blue red/ yellow red/ blue blue/ black !rice %(.&& %(.&& %(.&& (:.&& ta8 &.;& &.;& &.;& %.(:
"able is not in first normal form because: Multi!le items in color field Du!licate records / no !rimary key
$/ % $/ &' '
()am#le
item "<shirt "<shirt !olo !olo sweatshirt sweatshirt color red blue red yellow blue black !rice %(.&& %(.&& %(.&& %(.&& (:.&& (:.&& ta8 &.;& &.;& &.;& &.;& %.(: %.(:
www.lib.ku.edu/instruction
$/ % $/ &'
()am#le
item "<shirt "<shirt !olo !olo sweatshirt sweatshirt color red blue red yellow blue black !rice %(.&& %(.&& %(.&& %(.&& (:.&& (:.&& ta8 &.;& &.;& &.;& &.;& %.(: %.(:
"able is not in second normal form because: #ri"e and ta) de!end on
$/ % $/ &'
www.lib.ku.edu/instruction
()am#le
item "<shirt "<shirt !olo !olo sweatshirt sweatshirt color red blue red yellow blue black item "<shirt !olo sweatshirt !rice %(.&& %(.&& (:.&& ta8 &.;& &.;& %.(:
$/ % $/ &'
%(
www.lib.ku.edu/instruction
()am#le
item "<shirt "<shirt !olo !olo sweatshirt sweatshirt color red blue red yellow blue black item "<shirt !olo sweatshirt !rice %(.&& %(.&& (:.&& ta8 &.;& &.;& %.(:
()am#le
item "<shirt "<shirt !olo !olo sweatshirt sweatshirt color red blue red yellow blue black !rice %(.&& (:.&& "ables are now in third normal form.
$/ % $/ &' %9
&.;& %.(:
www.lib.ku.edu/instruction
,nother ()am#le
?ame @eff Smith ?ancy @ones @ane Scott Assignment % Article Summary Article Summary Article Summary Assignment ( Poetry Analysis Reaction Pa!er Poetry Analysis
"able is not in first normal form because: Assignment field re!eating 4irst and last name in one field ?o Aguaranteed uni5ueB !rimary key field
$/ % $/ &' %:
,nother ()am#le
Assignment *D % ( 6 Descri!tion Article Summary Poetry Analysis Reaction Pa!er Assignment *D % % % Student *D % ( 6 4irst ?ame @eff ?ancy @ane .ast ?ame Smith @ones Scott ( ( 6 Student *D % ( 6 % 6 (
www.lib.ku.edu/instruction
Relationshi#s
Relationshi!s are created between tables using the !rimary key field and a foreign key field
Cne to Cne Relationshi!
Cne record in a table relates to one record in another table
$/ % $/ &'
%'
www.lib.ku.edu/instruction
Student *D % ( 6 % 6 (
-ibliogra#hy
Dernande#/ Michael @. Database Design for Mere Mortals. San 4rancisco: Addison<Wesley/ %$$'. 0ha!!le/ Mike. 1 Database ?ormali#ation Easics.2 : August (&&%. Cnline. *nternet. A+ailable htt!://databases.about.com/library/weekly/aa&=&:&%a.htm Association for >eogra!hic *nformation. >*S Dictionary. %$$$. Cnline. *nternet. A+ailable htt!://www.geo.ed.ac.uk/agide8e/term =(% Wise/ Earry. 1Database ?ormali#ation and Design "echni5ues.2 % August (&&&. ; !!. Cnline. *nternet. A+ailable htt!://www.!h!builder.com/columns/barry(&&&&'6%.!h!6
$/ % $/ &'
(&
www.lib.ku.edu/instruction
F!rther Reading
Darrington/ @an .. Relational Database Design 0learly 78!lained. San Diego: Academic 78!ress/ %$$=. 0ha!!le/ Mike. 10hoosing a Database Product.2 ; May (&&%. Cnline. *nternet. A+ailable htt!://databases.about.com/library/weekly/aa&:&;&%a.htm >ilmore/ W.@. 1*ntroduction to Database ?ormali#ation.2 (' ?o+ember (&&&. Cnline. *nternet. A+ailable htt!://www.de+shed.com/Ser+erFSide/MySG./?ormal/?ormal %/!age%.html
$/ % $/ &'
(%