SlideShare a Scribd company logo
3
Most read
5
Most read
6
Most read
www.lib.ku.edu/instruction




                                     Database Design
                                  Practical Database Design for
                                            Relational Database
                                         Management Systems




                      Overview
                           A little background and terminology:
                                What is a relational database?
                                What is a primary key?
                                What is a foreign key?
                           Things to know about designing a database:
                                The normalization process and how/why use it
                                Relating tables
                                Types of relationships

                      9/19/07                                                  2




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Relational Database Management
                      System

                           Collection of information organized in tables
                                Tables are also “relations”
                           Tables are constructed and associated to each other
                           through shared fields–“common” fields
                                Fields are also “columns” or “attributes”
                           A set of attributes comprises a record
                                Records are also “rows” or “tuples”
                           Tables are related through common fields
                           designated as primary and foreign keys
                           Allow us to find, update, and delete data quickly,
                           and help to ensure accuracy
                      9/19/07                                                     3




                      Primary and Foreign Key
                      Fields
                           Primary Key
                                Primary key fields must be unique and cannot
                                contain a null value.
                                Each table should have a primary key field.
                                Concatenated keys: using more than one field as
                                a primary key field.
                           Foreign Key: Fields in a table that refer to
                           the primary key in another table
                                The data in this field must exactly match data
                                contained in the primary key field.
                      9/19/07                                                     4




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      What is Normalization?
                           The process by which we efficiently organize data to achieve
                           these goals:
                                Eliminating redundancy
                                Ensuring data is stored in the correct table
                                Eliminating need for restructuring database when data is added.
                           Five levels of normal form
                                In order to achieve one level of normal form, each previous level
                                must be met


                                        Third normal form is sufficient for
                                        most typical database applications.

                      9/19/07                                                                       5




                      First Normal Form (1NF)
                           There are no repeating or duplicate fields.
                           Each cell contains only a single value.
                           Each record is unique.
                                Identified by primary key




                      9/19/07                                                                       6




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Example
                      item                 colors          price     tax
                      T-shirt              red, blue       12.00     0.60
                      polo                 red, yellow     12.00     0.60
                      T-shirt              red, blue       12.00     0.60
                      sweatshirt           blue, black     25.00     1.25

                      Table is not in first normal form because:
                                Multiple items in color field
                                Duplicate records / no primary key

                      9/19/07                                               7




                      Example
                      item                 color           price     tax
                      T-shirt              red             12.00     0.60
                      T-shirt              blue            12.00     0.60
                      polo                 red             12.00     0.60
                      polo                 yellow          12.00     0.60
                      sweatshirt           blue            25.00     1.25
                      sweatshirt           black           25.00     1.25

                      Table is now in first normal form.

                      9/19/07                                               8




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Second Normal Form (2NF)
                           All non-key fields depend on all components
                           of the primary key.
                                Guaranteed when primary key is a single field.




                      9/19/07                                                    9




                      Example
                      item               color          price         tax
                      T-shirt            red            12.00         0.60
                      T-shirt            blue           12.00         0.60
                      polo               red            12.00         0.60
                      polo               yellow         12.00         0.60
                      sweatshirt         blue           25.00         1.25
                      sweatshirt         black          25.00         1.25
                      Table is not in second normal form because:
                                price and tax depend on item, but not color
                      9/19/07                                                    10




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Example
                      item             color         item         price   tax
                      T-shirt          red           T-shirt      12.00   0.60
                      T-shirt          blue          polo         12.00   0.60
                      polo             red           sweatshirt   25.00   1.25
                      polo             yellow
                      sweatshirt       blue
                      sweatshirt       black

                      Tables are now in second normal form.

                      9/19/07                                                    11




                      Third Normal Form (3NF)
                           No non-key field depends upon another.
                                All non-key fields depend only on the primary key.




                      9/19/07                                                    12




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Example
                      item               color        item              price            tax
                      T-shirt            red          T-shirt           12.00            0.60
                      T-shirt            blue         polo              12.00            0.60
                      polo               red          sweatshirt        25.00            1.25
                      polo               yellow
                      sweatshirt         blue
                      sweatshirt         black

                      Tables are not in third normal form because:
                                tax depends on price, not item
                      9/19/07                                                                   13




                      Example
                            item            color            item                price
                            T-shirt         red              T-shirt             12.00
                            T-shirt         blue             polo                12.00
                            polo            red              sweatshirt          25.00
                            polo            yellow
                            sweatshirt      blue                price     tax
                            sweatshirt      black               12.00     0.60
                                                                25.00     1.25

                      Tables are now in third normal form.
                      9/19/07                                                                   14




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Another Example
                           Name                              Assignment 1           Assignment 2
                           Jeff Smith                        Article Summary        Poetry Analysis

                           Nancy Jones                       Article Summary        Reaction Paper

                           Jane Scott                        Article Summary        Poetry Analysis


                           Table is not in first normal form because:
                                    Assignment field repeating
                                    First and last name in one field
                                    No (guaranteed unique) primary key field
                      9/19/07                                                                                   15




                      Another Example
                       Assignment ID           Description
                       1                       Article Summary                 Assignment ID       Student ID
                       2                       Poetry Analysis                 1                   1
                       3                       Reaction Paper                  1                   2
                                                                               1                   3
                                                                               2                   1
                       Student ID       First Name      Last Name
                                                                               2                   3
                       1                Jeff            Smith
                                                                               3                   2
                       2                Nancy           Jones
                       3                Jane            Scott

                     Tables are in third normal form.
                      9/19/07                                                                                   16




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Relationships
                           Relationships are created between tables using the
                           primary key field and a foreign key field
                                One to One Relationship
                                 One record in a table relates to one record in another table
                                One to Many Relationship
                                 One record in a table can relate to many records in another
                                 table
                                Many to Many Relationship
                                 Many records in one table can relate to many records in
                                 another table


                      9/19/07                                                                  17




                      Relationships in First Example
                      item              color                      item                price
                      T-shirt           red                        T-shirt             12.00
                      T-shirt           blue                       polo                12.00
                      polo              red                        sweatshirt          25.00
                      polo              yellow
                      sweatshirt        blue
                      sweatshirt        black
                                                                    price       tax
                                      one to one                    12.00       0.60
                                      one to many                   25.00       1.25
                      9/19/07                                                                  18




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                         Relationships in Second Example
                     Assignment ID          Description
                     1                      Article Summary      Assignment ID     Student ID

                     2                      Poetry Analysis      1                 1

                     3                      Reaction Paper       1                 2
                                                                 1                 3
                                                                 2                 1
                                                                 2                 3
                     Student ID      First Name      Last Name   3                 2
                     1               Jeff            Smith
                                                                                 one to one
                     2               Nancy           Jones
                                                                                 one to many
                     3               Jane            Scott                       many to many
                         9/19/07                                                                19




                         Bibliography
                              Hernandez, Michael J. Database Design for Mere Mortals.
                              San Francisco: Addison-Wesley, 1997.
                              Chapple, Mike. “ Database Normalization Basics.” 5 August
                              2001. Online. Internet. Available
                              http://databases.about.com/library/weekly/aa080501a.htm
                              Association for Geographic Information. GIS Dictionary. 1999.
                              Online. Internet.
                              Available http://www.geo.ed.ac.uk/agidexe/term?821
                              Wise, Barry. “Database Normalization and Design
                              Techniques.” 1 August 2000. 6 pp. Online. Internet. Available
                              http://www.phpbuilder.com/columns/barry20000731.php3

                         9/19/07                                                                20




© 2007 Instructional Services at KU Libraries, The University of Kansas
www.lib.ku.edu/instruction




                      Further Reading
                           Harrington, Jan L. Relational Database Design Clearly
                           Explained. San Diego: Academic Express, 1998.
                           Chapple, Mike. “Choosing a Database Product.” 6 May 2001.
                           Online. Internet. Available
                           http://databases.about.com/library/weekly/aa050601a.htm
                           Gilmore, W.J. “Introduction to Database Normalization.” 27
                           November 2000. Online. Internet. Available
                           http://www.devshed.com/Server_Side/MySQL/Normal/Normal
                           1/page1.html




                      9/19/07                                                       21




© 2007 Instructional Services at KU Libraries, The University of Kansas

More Related Content

What's hot (20)

PPT
Databases: Normalisation
Damian T. Gordon
 
PPT
Data models
Usman Tariq
 
PPT
data modeling and models
sabah N
 
PPTX
Relational Database Design
Archit Saxena
 
PPTX
Normalization in DBMS
Prateek Parimal
 
PPTX
Shadow paging
GowriLatha1
 
PPTX
Relational model
Dabbal Singh Mahara
 
PPTX
Integrity Constraints
madhav bansal
 
PPTX
Data Modeling PPT
Trinath
 
PPTX
Database System Architectures
Information Technology
 
PPTX
Relational Data Model Introduction
Nishant Munjal
 
PPT
Dbms relational model
Chirag vasava
 
PPTX
Distributed database management system
Pooja Dixit
 
PPTX
Normalization
Salman Memon
 
PPTX
Normalization in databases
baabtra.com - No. 1 supplier of quality freshers
 
PPT
File organization 1
Rupali Rana
 
PPT
Advanced sql
Dhani Ahmad
 
DOC
Dbms lab questions
Parthipan Parthi
 
PPTX
normaliztion
Ramadhani S. Zuberi
 
Databases: Normalisation
Damian T. Gordon
 
Data models
Usman Tariq
 
data modeling and models
sabah N
 
Relational Database Design
Archit Saxena
 
Normalization in DBMS
Prateek Parimal
 
Shadow paging
GowriLatha1
 
Relational model
Dabbal Singh Mahara
 
Integrity Constraints
madhav bansal
 
Data Modeling PPT
Trinath
 
Database System Architectures
Information Technology
 
Relational Data Model Introduction
Nishant Munjal
 
Dbms relational model
Chirag vasava
 
Distributed database management system
Pooja Dixit
 
Normalization
Salman Memon
 
File organization 1
Rupali Rana
 
Advanced sql
Dhani Ahmad
 
Dbms lab questions
Parthipan Parthi
 
normaliztion
Ramadhani S. Zuberi
 

Viewers also liked (20)

PPT
DBMS - Normalization
Jitendra Tomar
 
PPT
Normalization
ochesing
 
PPS
Crj 3 1-b
Niit Care
 
PPTX
ERD Case scenario
markthesuth
 
PPTX
Database Normalization
Rathan Raj
 
PPTX
Entity relationship diagram - Concept on normalization
Satya Pal
 
PPT
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ARADHYAYANA
 
PPTX
Dbms architecture
Shubham Dwivedi
 
PPT
Indexing and hashing
Jeet Poria
 
PPTX
Database management system basic, database, database management, learn databa...
University of Science and Technology Chitttagong
 
PPT
Relational Algebra-Database Systems
jakodongo
 
PPS
Architecture of-dbms-and-data-independence
Anuj Modi
 
PPT
Relational algebra in dbms
shekhar1991
 
DOC
A database design_report_for_college_library final
Saira Iqbal
 
PPT
PLM Introduction
Jayakumar Vadivelu
 
PPT
Trigger
Slideshare
 
PPT
12. Indexing and Hashing in DBMS
koolkampus
 
PPT
ERP Implementation Life Cycle
Apurv Gourav
 
PPTX
Business process reengineering
Neelkamal Sharma
 
DBMS - Normalization
Jitendra Tomar
 
Normalization
ochesing
 
Crj 3 1-b
Niit Care
 
ERD Case scenario
markthesuth
 
Database Normalization
Rathan Raj
 
Entity relationship diagram - Concept on normalization
Satya Pal
 
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ARADHYAYANA
 
Dbms architecture
Shubham Dwivedi
 
Indexing and hashing
Jeet Poria
 
Database management system basic, database, database management, learn databa...
University of Science and Technology Chitttagong
 
Relational Algebra-Database Systems
jakodongo
 
Architecture of-dbms-and-data-independence
Anuj Modi
 
Relational algebra in dbms
shekhar1991
 
A database design_report_for_college_library final
Saira Iqbal
 
PLM Introduction
Jayakumar Vadivelu
 
Trigger
Slideshare
 
12. Indexing and Hashing in DBMS
koolkampus
 
ERP Implementation Life Cycle
Apurv Gourav
 
Business process reengineering
Neelkamal Sharma
 
Ad

Similar to Database design & Normalization (1NF, 2NF, 3NF) (20)

PDF
Databasedesign 120815192523-phpapp02
Kanchana Herath
 
PDF
Databasedesign 120815192523-phpapp02
S.M. Hasan
 
PDF
Structured Query Language
Prof. Erwin Globio
 
DOC
5.01 Activity Notes A
wmassie
 
PPTX
Types of Keys use in Database Management.pptx
nrssgyedpmandit1
 
PPTX
Handout-Normal Forms-Db Indexescombo.pptx
oforjose30
 
PPTX
Databases
guestf77c65c
 
PPTX
Feb 2nd Makeup Class
George Saban
 
PDF
Lesson 01 - Introduction to SQL
Angel G Diaz
 
PPT
Normalization
AabKunal Grover
 
PDF
Ecdl v5 module 5 print
Michael Lew
 
PPTX
Advance sqlite3
Raghu nath
 
PPTX
18 database features
Rebecca Jones
 
PDF
Database Basics
HripsimeGhaltaghchya
 
PPTX
Database Presentation
Malik Ghulam Murtza
 
PDF
Normalization2
rupaliz
 
PDF
Access2007 m1
jigeno
 
PPTX
Advance Sqlite3
Raghu nath
 
Databasedesign 120815192523-phpapp02
Kanchana Herath
 
Databasedesign 120815192523-phpapp02
S.M. Hasan
 
Structured Query Language
Prof. Erwin Globio
 
5.01 Activity Notes A
wmassie
 
Types of Keys use in Database Management.pptx
nrssgyedpmandit1
 
Handout-Normal Forms-Db Indexescombo.pptx
oforjose30
 
Databases
guestf77c65c
 
Feb 2nd Makeup Class
George Saban
 
Lesson 01 - Introduction to SQL
Angel G Diaz
 
Normalization
AabKunal Grover
 
Ecdl v5 module 5 print
Michael Lew
 
Advance sqlite3
Raghu nath
 
18 database features
Rebecca Jones
 
Database Basics
HripsimeGhaltaghchya
 
Database Presentation
Malik Ghulam Murtza
 
Normalization2
rupaliz
 
Access2007 m1
jigeno
 
Advance Sqlite3
Raghu nath
 
Ad

More from Jargalsaikhan Alyeksandr (20)

PDF
Microsoft IT Academy
Jargalsaikhan Alyeksandr
 
PPTX
Computer ethics and system security
Jargalsaikhan Alyeksandr
 
PPTX
Cs203 lecture 14 reflection
Jargalsaikhan Alyeksandr
 
PPTX
Cs203 lecture13 composition
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture12 Composition
Jargalsaikhan Alyeksandr
 
PPT
SW203 Lab10
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture10 Polymorphism
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture9 Encapsulation
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture5 Class Acess Modifiers
Jargalsaikhan Alyeksandr
 
PPS
S W203 Lecture8 Interface
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture8 Interface
Jargalsaikhan Alyeksandr
 
PPT
Sw203 Lecture11 Casting
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture7 Method Override
Jargalsaikhan Alyeksandr
 
PPS
Sw203 Lecture6 Inheritance
Jargalsaikhan Alyeksandr
 
Microsoft IT Academy
Jargalsaikhan Alyeksandr
 
Computer ethics and system security
Jargalsaikhan Alyeksandr
 
Cs203 lecture 14 reflection
Jargalsaikhan Alyeksandr
 
Cs203 lecture13 composition
Jargalsaikhan Alyeksandr
 
Sw203 Lecture12 Composition
Jargalsaikhan Alyeksandr
 
Sw203 Lecture10 Polymorphism
Jargalsaikhan Alyeksandr
 
Sw203 Lecture9 Encapsulation
Jargalsaikhan Alyeksandr
 
Sw203 Lecture5 Class Acess Modifiers
Jargalsaikhan Alyeksandr
 
S W203 Lecture8 Interface
Jargalsaikhan Alyeksandr
 
Sw203 Lecture8 Interface
Jargalsaikhan Alyeksandr
 
Sw203 Lecture11 Casting
Jargalsaikhan Alyeksandr
 
Sw203 Lecture7 Method Override
Jargalsaikhan Alyeksandr
 
Sw203 Lecture6 Inheritance
Jargalsaikhan Alyeksandr
 

Recently uploaded (20)

PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 

Database design & Normalization (1NF, 2NF, 3NF)

  • 1. www.lib.ku.edu/instruction Database Design Practical Database Design for Relational Database Management Systems Overview A little background and terminology: What is a relational database? What is a primary key? What is a foreign key? Things to know about designing a database: The normalization process and how/why use it Relating tables Types of relationships 9/19/07 2 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 2. www.lib.ku.edu/instruction Relational Database Management System Collection of information organized in tables Tables are also “relations” Tables are constructed and associated to each other through shared fields–“common” fields Fields are also “columns” or “attributes” A set of attributes comprises a record Records are also “rows” or “tuples” Tables are related through common fields designated as primary and foreign keys Allow us to find, update, and delete data quickly, and help to ensure accuracy 9/19/07 3 Primary and Foreign Key Fields Primary Key Primary key fields must be unique and cannot contain a null value. Each table should have a primary key field. Concatenated keys: using more than one field as a primary key field. Foreign Key: Fields in a table that refer to the primary key in another table The data in this field must exactly match data contained in the primary key field. 9/19/07 4 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 3. www.lib.ku.edu/instruction What is Normalization? The process by which we efficiently organize data to achieve these goals: Eliminating redundancy Ensuring data is stored in the correct table Eliminating need for restructuring database when data is added. Five levels of normal form In order to achieve one level of normal form, each previous level must be met Third normal form is sufficient for most typical database applications. 9/19/07 5 First Normal Form (1NF) There are no repeating or duplicate fields. Each cell contains only a single value. Each record is unique. Identified by primary key 9/19/07 6 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 4. www.lib.ku.edu/instruction Example item colors price tax T-shirt red, blue 12.00 0.60 polo red, yellow 12.00 0.60 T-shirt red, blue 12.00 0.60 sweatshirt blue, black 25.00 1.25 Table is not in first normal form because: Multiple items in color field Duplicate records / no primary key 9/19/07 7 Example item color price tax T-shirt red 12.00 0.60 T-shirt blue 12.00 0.60 polo red 12.00 0.60 polo yellow 12.00 0.60 sweatshirt blue 25.00 1.25 sweatshirt black 25.00 1.25 Table is now in first normal form. 9/19/07 8 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 5. www.lib.ku.edu/instruction Second Normal Form (2NF) All non-key fields depend on all components of the primary key. Guaranteed when primary key is a single field. 9/19/07 9 Example item color price tax T-shirt red 12.00 0.60 T-shirt blue 12.00 0.60 polo red 12.00 0.60 polo yellow 12.00 0.60 sweatshirt blue 25.00 1.25 sweatshirt black 25.00 1.25 Table is not in second normal form because: price and tax depend on item, but not color 9/19/07 10 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 6. www.lib.ku.edu/instruction Example item color item price tax T-shirt red T-shirt 12.00 0.60 T-shirt blue polo 12.00 0.60 polo red sweatshirt 25.00 1.25 polo yellow sweatshirt blue sweatshirt black Tables are now in second normal form. 9/19/07 11 Third Normal Form (3NF) No non-key field depends upon another. All non-key fields depend only on the primary key. 9/19/07 12 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 7. www.lib.ku.edu/instruction Example item color item price tax T-shirt red T-shirt 12.00 0.60 T-shirt blue polo 12.00 0.60 polo red sweatshirt 25.00 1.25 polo yellow sweatshirt blue sweatshirt black Tables are not in third normal form because: tax depends on price, not item 9/19/07 13 Example item color item price T-shirt red T-shirt 12.00 T-shirt blue polo 12.00 polo red sweatshirt 25.00 polo yellow sweatshirt blue price tax sweatshirt black 12.00 0.60 25.00 1.25 Tables are now in third normal form. 9/19/07 14 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 8. www.lib.ku.edu/instruction Another Example Name Assignment 1 Assignment 2 Jeff Smith Article Summary Poetry Analysis Nancy Jones Article Summary Reaction Paper Jane Scott Article Summary Poetry Analysis Table is not in first normal form because: Assignment field repeating First and last name in one field No (guaranteed unique) primary key field 9/19/07 15 Another Example Assignment ID Description 1 Article Summary Assignment ID Student ID 2 Poetry Analysis 1 1 3 Reaction Paper 1 2 1 3 2 1 Student ID First Name Last Name 2 3 1 Jeff Smith 3 2 2 Nancy Jones 3 Jane Scott Tables are in third normal form. 9/19/07 16 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 9. www.lib.ku.edu/instruction Relationships Relationships are created between tables using the primary key field and a foreign key field One to One Relationship One record in a table relates to one record in another table One to Many Relationship One record in a table can relate to many records in another table Many to Many Relationship Many records in one table can relate to many records in another table 9/19/07 17 Relationships in First Example item color item price T-shirt red T-shirt 12.00 T-shirt blue polo 12.00 polo red sweatshirt 25.00 polo yellow sweatshirt blue sweatshirt black price tax one to one 12.00 0.60 one to many 25.00 1.25 9/19/07 18 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 10. www.lib.ku.edu/instruction Relationships in Second Example Assignment ID Description 1 Article Summary Assignment ID Student ID 2 Poetry Analysis 1 1 3 Reaction Paper 1 2 1 3 2 1 2 3 Student ID First Name Last Name 3 2 1 Jeff Smith one to one 2 Nancy Jones one to many 3 Jane Scott many to many 9/19/07 19 Bibliography Hernandez, Michael J. Database Design for Mere Mortals. San Francisco: Addison-Wesley, 1997. Chapple, Mike. “ Database Normalization Basics.” 5 August 2001. Online. Internet. Available http://databases.about.com/library/weekly/aa080501a.htm Association for Geographic Information. GIS Dictionary. 1999. Online. Internet. Available http://www.geo.ed.ac.uk/agidexe/term?821 Wise, Barry. “Database Normalization and Design Techniques.” 1 August 2000. 6 pp. Online. Internet. Available http://www.phpbuilder.com/columns/barry20000731.php3 9/19/07 20 © 2007 Instructional Services at KU Libraries, The University of Kansas
  • 11. www.lib.ku.edu/instruction Further Reading Harrington, Jan L. Relational Database Design Clearly Explained. San Diego: Academic Express, 1998. Chapple, Mike. “Choosing a Database Product.” 6 May 2001. Online. Internet. Available http://databases.about.com/library/weekly/aa050601a.htm Gilmore, W.J. “Introduction to Database Normalization.” 27 November 2000. Online. Internet. Available http://www.devshed.com/Server_Side/MySQL/Normal/Normal 1/page1.html 9/19/07 21 © 2007 Instructional Services at KU Libraries, The University of Kansas