Racoosin 703 849-1997 Database Normalization TJ Racoosin 2 Dec 1998 CPCUG Access SIG.

Slides:



Advertisements
Similar presentations
Designing MS-Access Tables
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Chapter 10: Designing Databases
1 Logical Database Design and the Relational Model Modern Database Management.
Systems Development Life Cycle
© 2005 by Prentice Hall 1 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 7 th Edition Jeffrey A. Hoffer, Mary B.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Terms - data,information, file record, table, row, column, transaction, concurrency Concepts - data integrity, data redundancy, Type of databases – single-user,
DATA RESOURCE MANAGEMENT.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
Normalization. Database Normalization Database normalization is the process of removing redundant data from your tables in to improve storage efficiency,
Cambridge TEC - Level 3 Certificate/Diploma IT. ICT Dept ScenarioLO1LO2LO3.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Database Normalization Lynne Weldon July 17, 2000.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
CORE 2: Information systems and Databases NORMALISING DATABASES.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Organizing Data Revision: pages 8-10, 31 Chapter 3.
Copyright © 2005 Ed Lance Fundamentals of Relational Database Design By Ed Lance.
Chapter 12: Designing Databases
Chapter 1Introduction to Oracle9i: SQL1 Chapter 1 Overview of Database Concepts.
Introduction to Database using Microsoft Access 2013 Part 7 November 19, 2014.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Rules of Database Normalization
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Normalization CSC 3800 Fall 2008.
A337 - Reed Smith1 Structure What is a database? –Table of information Rows are referred to as records Columns are referred to as fields Record identifier.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
Logical Database Design and the Relational Model.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Normalization Hour1,2 Presented & Modified by Mahmoud Rafeek Alfarra.
IST Database Normalization Todd Bacastow IST 210.
NORMALIZATION: ‘1NF’ The general rule: ‘’Any field which can have many, must have its own table’’ By Sam Beaumont.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
Chapter 4, Part A: Logical Database Design and the Relational Model
Lecture 4: Logical Database Design and the Relational Model 1.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Logical Database Design and Relational Data Model Muhammad Nasir
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Database Planning Database Design Normalization.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Lecture # 17 Chapter # 10 Normalization Database Systems.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
Understanding Data Storage
The Relational Model and Database Normalization
Normalization Karolina muszyńska
A brief summary of database normalization
Chapter 5: Logical Database Design and the Relational Model
CIS 155 Table Relationship
Databases A brief introduction….
Database Normalization
Normalization Referential Integrity
Presentation transcript:

Racoosin Database Normalization TJ Racoosin 2 Dec 1998 CPCUG Access SIG

Overview Introductions The Normal Forms Primary Key Relationships and Referential Integrity When NOT to Normalize Real World Exercise Resources Racoosin Solutions

Introductions TJ Racoosin You –Are you familiar with normalization? –Used the relationship window ? Enforce referential integrity? Cascade Delete? –Any issues with normalizing data? Racoosin Solutions

Why Normalize? Flexibility –Structure supports many ways to look at the data Data Integrity –“Modification Anomalies” Deletion Insertion Update Efficiency –Eliminate redundant data and save space Racoosin Solutions

Normalization Defined “ In relational database design, the process of organizing data to minimize duplication. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.” - Webopedia, Racoosin Solutions

Another Definition "Normalization" refers to the process of creating an efficient, reliable, flexible, and appropriate "relational" structure for storing information. Normalized data must be in a "relational" data structure. - Reid Software Development, Racoosin Solutions

The Normal Forms A series of logical steps to take to normalize data tables First Normal Form Second Third Boyce Codd There’s more, but beyond scope of this Racoosin Solutions

First Normal Form (1NF) All columns (fields) must be atomic –Means : no repeating items in columns Racoosin Solutions Solution: make a separate table for each set of attributes with a primary key (parser, append query) Customers CustomerID Name Orders OrderID Item CustomerID OrderDate

Second Normal Form (2NF) In 1NF and every non-key column is fully dependent on the (entire) primary key –Means : Do(es) the key field(s) imply the rest of the fields? Do we need to know both OrderID and Item to know the Customer and Date? Clue: repeating fields Racoosin Solutions Solution: Remove to a separate table (Make Table) OrderDetails OrderID Item Orders OrderID CustomerID OrderDate

Third Normal Form (3NF) In 2NF and every non-key column is mutually independent –means : Calculations Racoosin Solutions Solution: Put calculations in queries and forms OrderDetails OrderID Item Quantity Price Put expression in text control or in query: =Quantity * Price

2/16/9810 MGS 404 2/16/9810 Boyce-Codd Form (3NF) - Examples A more restricted version of 3NF (known as Boyce-Codd Normal Form) requires that the determinant of every functional dependency in a relation be a key - for every FD: X => Y, X is a key Consider the following relation: STU-MAJ-ADV (Student-Id, Major, Advisor) Advisor => Major, but Advisor is not a key Boyce-Codd Normal Form for above: STU-ADV (Student-Id, Advisor) ADV-MAJ (Advisor, Major) Kumar Madurai:

Primary Key Unique Identifier for every row in the table –Integers vice Text to save memory, increase speed –Can be “composite” –Surrogate is best bet! Meaningless, numeric column acting as primary key in lieu of something like SSN or phone number - (both can be reissued!) Racoosin Solutions

Relationships Racoosin Solutions One to many to enforce “Referential Integrity” Two “foreign” keys make a composite primary key and “relate” many to many tables A look up table - it doesn’t reference any others

Table Prefixes Aid Development –First, we’ll get replace text PK with number –The Items table is a “look up” with tlkp prefix –tlkp “lookup” table (no “foreign keys”) –OrderDetails is renamed “trelOrderItem” a “relational” table trel “relational” (or junction or linking) –two foreign keys make a primary Racoosin Solutions tblOrders OrderID CustomerID OrderDate OrderDetails OrderID Item trelOrderItem OrderID ItemID tlkpItems ItemID ItemName

Referential Integrity Every piece of “foreign” key data has a primary key on the one site of the relationship –No “orphan” records. Every child has a parent –Can ’t delete records from primary table if in related table Benefits - Data Integrity and Propagation –If update fields in main table, reflected in all queries –Can’t add a record in related table without adding it to main –Cascade Delete: If delete record from primary table, all children deleted - use with care! Better idea to “archive” –Cascade Update: If change the primary key field, will change foreign key Racoosin Solutions

When Not to Normalize Want to keep tables simple so user can make their own queries –Avoid processing multiple tables Archiving Records –If No need to perform complex queries or “resurrect” –Flatten and store in one or more tables Testing shows Normalization has poorer performance –“Sounds Like” field example –Can also try temp tables produced from Make Table queries Racoosin Solutions

Real World - School Data Racoosin Solutions StudentStudent Previous Current Last First Parent 1Parent 2 Teacher Teacher SmithReneeAnn JonesTheodore SmithHamilBurke Mills LucyBarbara MillsSteve Mills Hamil Burke JonesBrendanJennifer Jones Stephen Jones Hamil Burke …. Street AddressCityStatePostal CodeHome Phone 5551 Private HillAnnandaleVirginia (703) Acme CtAnnandaleVirginia (703) Gains StreetFairfaxVirginia (703) …. First Year Last Year Age ProgramEnrolledAttended BirthdayinSeptMap CoordNotes PF / 0 0 6/25/93522 A-3 PF96/97 08/14/93521 F-3 PH96/97 0 6/13/94421 A-4

One Possible Design Racoosin Solutions

Books Access97 Developers Handbook Litwin,Getz & Gilbert –Chapter 4 Access and SQL Server Developers Handbook Viescas, Gunderloy and Chipman –Chapter 2 Access97 Expert Solutions Lezynski –Chapter 10 Racoosin Solutions

Internet Papers Slides Racoosin Solutions