Relational Database Appendix

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Chapter 5 Normalization of Database Tables
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
Information Resources Management March 13, Agenda n Administrivia n Normalization n Homework #7 n Mid-Term #2.
Need for Normalization
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normalization of Database Tables
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Normalization of Database Tables
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Chapter 5 Normalization of Database Tables
LOGICAL DATABASE DESIGN
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Chapter 4: Logical Database Design and the Relational Model (Part II)
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Lecture 12 Inst: Haya Sammaneh
Web-Enabled Decision Support Systems
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
Concepts and Terminology Introduction to Database.
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Database Systems: Design, Implementation, and Management Tenth Edition
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
5 1 Chapter 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
1 A Guide to MySQL 2 Database Design Fundamentals.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Logical Database Design Relational Model. Logical Database Design Logical database design: process of transforming conceptual data model into a logical.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
1 A Guide to MySQL 2 Database Design Fundamentals.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design – Lecture 8
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
Normalization of Database Tables
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
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.
Chapter 4 Normalization of Database Tables. 2 Database Tables and Normalization Table is basic building block in database design Table is basic building.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Logical Database Design and the Relational Model.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Lecture 4: Logical Database Design and the Relational Model 1.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
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.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Normalization Karolina muszyńska
A brief summary of database normalization
Chapter 5: Logical Database Design and the Relational Model
Relational Model and ER Model: in a Nutshell
Presentation transcript:

Relational Database Appendix

ER Diagram Entity/relation Entity Subtype Relationship Composite Entity Bus 311: Fall 2003

Shorthand Description State (StateAbbrev, StateName, EnteredUnionOrder, StateBird, StatePopulation) Capital (CapitalName, StateAbbrev, YearDesignated, PhoneAreaCode, CapitalPopulation) Foreign Key: StateAbbrev to State relation City (StateAbbrev, CityName, CityPopulation) Crop (CropName, Exports, Imports) Production (StateAbbrev, CropName, Quantity) Foreign Key: CropName to Crop relation Shipping (StateAbbrev, OceanShoreline, ExportTonnage, ImportTonnage) Bus 311: Fall 2003

Integrity Constraints Ideally DBMS enforces integrity MS Access does a pretty good job Primary key constraints Must be unique and non-null Referential integrity Each no-null foreign key must match a primary key No ‘orphaned’ foreign keys Domain integrity constraint Rules specified for individual attributes Data type, number of characters etc. Validation rules Bus 311: Fall 2003

Dependencies and Determinants StateAbbrev functionally determines StatePopulation StatePopulation is functionally determined by StateAbbrev StateAbbrev is a determinant Bus 311: Fall 2003

Determinants Transitive Dependency Partial Dependencies StateAbbrev is a determinant for StatePopulation, StateBird, and BirdScientificName CropName is a determinant for Exports Quantity is functionally dependent on both StateAbbrev and CropName StateBird is a determinant for BirdScientificName Bus 311: Fall 2003

Problematic Dependencies Partial Dependency Funtional dependency on part of the primary key Transitive Dependency Functional dependency between two nonkey attributes Bus 311: Fall 2003

Anomalies Insertion Anomaly Deletion Anomaly Update Anomaly Can’t add row if don’t know part of primary key Can’t add new client without knowing a ChildName Deletion Anomaly Delete data and unintentionally lose other critical data Delete Client 8112, and lose all info on VetID 24 Update Anomaly Change one attribute and changes must be made other places Change ClientName for ClientID 4519, must change other record too Bus 311: Fall 2003

Normalization Process of bringing a relational database to an orderly form Eliminate problems Major process in database design Many normal forms – we consider three First Normal Form (1NF) Second Normal Form (2NF) Third Normal Form (3NF) – aka Boyce-Codd Normal Form (BCNF Bus 311: Fall 2003

First Normal Form (1NF) A relation is 1NF if it does not contain repeating groups Process Expand primary key to include primary key of repeating group – Independently for each repeating group Create new relation (table) for each repeating group Bus 311: Fall 2003

1NF result Still problems Insertion, deletion, and update anomalies in both relations Caused by partial dependencies (next slide) Bus 311: Fall 2003

Bus 311: Fall 2003

Second Normal Form (2NF) A relation in 1NF is in 2NF if it does not contain any partial dependencies Process Identify functional depencies for each attribute If necessary, create new relations to make each attribute functionally dependent on the entire primary key. New relations should have primary keys that are subsets of the original composite key A relation in 1NF with a single-attribute primary key is automatically in 2NF Bus 311: Fall 2003

Result of converting to 2NF Still problems? Transitive dependency between VetID and VetName All 3 anomalies exist in Client relation 3NF removes transitive dependencies Bus 311: Fall 2003

Third Normal Form (3NF) Boyce-Codd Normal Form (BCNF) is an improvement over original 3NF A 2NF relation is in 3NF when there are no transitive dependencies Process Remove attributes that depend on the non-candidate-key (non-primary key) Place in new relation with determinant as primary key Bus 311: Fall 2003

Result of converting to 3NF No data redundancy No anomalies Bus 311: Fall 2003

Exercises Gain a better understanding Do Review Questions at end of RD appendix RQ 1-6 will be on the exam! RQ 7 will help you get a better understanding of how to apply to real-world situations Some of RQ 8-14 are likely to be on the exam If you do RQ 15-18, I will be happy to discuss your solution with you Bus 311: Fall 2003