EECS 339 Lecture 3 Normalization Database Internals.

Slides:



Advertisements
Similar presentations
Review for Final Exam Lecture Week 14. Problems on Functional Dependencies and Normal Forms.
Advertisements

6.830/6.814 Lecture 3 Sam Madden Relational Algebra and Normalization Sept 10, 2014.
6.830 Lecture 9 10/1/2014 Join Algorithms. Database Internals Outline Front End Admission Control Connection Management (sql) Parser (parse tree) Rewriter.
6.830/6.814 Lecture 5 Database Internals Continued September 17, 2014.
Normalization Dr. Mario Guimaraes. Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints.
Ch 10, Functional Dependencies and Normal forms
Relational Normalization Theory. Limitations of E-R Designs Provides a set of guidelines, does not result in a unique database schema Does not provide.
Hobby Schema SSNNameAddressHobbyCost 123johnmain stdolls$ 123johnmain stbugs$ 345marylake sttennis$$ 456joefirst stdolls$ “Wide” schema – has redundancy.
EECS 339 Lecture 2 Schema Design, Relational Algebra Jennie Duggan January 13, 2014.
Murali Mani Normalization. Murali Mani What and Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert,
Functional Dependencies, Normalization Rose-Hulman Institute of Technology Curt Clifton.
Accounting 6500 Relational Databases: Accounting Applications Introduction to Normalization.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 Review #1 l Intro stuff –What is a database, 4 parts, 3 users, etc. l Architecture –Data independence –Three levels, two mappings –Jobs of the DBA.
Functional Dependencies Definition: If two tuples agree on the attributes A, A, … A 12n then they must also agree on the attributes B, B, … B 12m Formally:
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Chapter 5 Normalization of Database Tables
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
Databases 6: Normalization
BCNF vs 3NF BCNF: For every functional dependency X->Y in a set F of functional dependencies over relation R, either: –Y is a subset of X or, –X is a superkey.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Functional Dependencies and Relational Schema Design.
Normalization Quiz Tao Li Grant Horntvedt. 1. Which of the following statements is true: a. Normal forms can be derived by inspecting the data in various.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Chapter 5 Normalization of Database Tables
Lecture 11 Main Memory Databases Midterm Review. Time breakdown for Shore DBMS Source: “OLTP Under the Looking Glass”, SIGMOD 2008 Systematically removed.
Relational Database Design by Relational Database Design by Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
Hobby Schema SSNNameAddressHobbyCost 123johnmain stdolls$ 123johnmain stbugs$ 345marylake sttennis$$ 456joefirst stdolls$ “Wide” schema – has redundancy.
Functional Dependencies and Normalization for Relational Databases.
Lecture 5 Cost Estimation and Data Access Methods.
IST 318 – DB Administration
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
© D. Wong Ch. 3 (continued)  Database design problems  Functional Dependency  Keys of relations  Decompositions based on Functional Dependency.
6.830 Lecture 6 9/28/2015 Cost Estimation and Indexing.
Normalization of Database Tables
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Database Design and Normalization (based on notes by Silberchatz,Korth,
CS 157B Database Systems Dr. T Y Lin. Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Database design and normalization.
Ch 7: Normalization-Part 1
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
CS411 Database Systems Kazuhiro Minami 04: Relational Schema Design.
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 1 Normalization DB Design Guidelines Presented by: Dr. Samir Tartir.
Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke1 Schema Refinement and Normal Forms Chapter 19.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
1 Dept. of CIS, Temple Univ. CIS661 – Principles of Data Management V. Megalooikonomou Database design and normalization (based on slides by C. Faloutsos.
Copyright © Curt Hill Schema Refinement II 2 nd NF to 3 rd NF to BCNF.
5 1 Normalization of Database Tables. 5 2 Database Tables and Normalization Normalization –Process for evaluating and correcting table structures to minimize.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Decomposition and Normalization Fan Qi
1 Lecture 9: Database Design Wednesday, January 25, 2006.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Formal definition of a key A key is a set of attributes A 1,..., A n such that for any other attribute B: A 1,..., A n  B A minimal key is a set of attributes.
Functional Dependencies
CPSC-310 Database Systems
Database Normalization
Relational Algebra and Normalization 9/13/2017
Normalization.
Normalization DB Design Guidelines Presented by: Dr. Samir Tartir
DATABASE DESIGN & DEVELOPMENT
Review #1 Intro stuff What is a database, 4 parts, 3 users, etc.
Presentation transcript:

EECS 339 Lecture 3 Normalization Database Internals

Hobby Schema SSNNameAddressHobbyCost 123johnmain stdolls$ 123johnmain stbugs$ 345marylake sttennis$$ 456joefirst stdolls$ “Wide” schema – has redundancy and anomalies in the presence of updates, inserts, and deletes Table key is Hobby, SSN Person Hobby SSN Address Name Cost n:n Entity Relationship Diagram

BCNFify Example for Hobbies SchemaFDs (S,H,N,A,C)S,H  N,A,C S  N, A H  C S = SSN, H = Hobby, N = Name, A = Addr, C = Cost violates bcnf SchemaFDs (S, N,A)S  N, A SchemaFDs (S,H, C)S,H  C H  C violates bcnf SchemaFDs (H, C)H  C SchemaFDs (S,H) Iter 1 Iter 2 key Iter 3

Non-BCNF Example AccountClientOffice AJoe1 BMary1 AJohn1 CJoe2 Primary Key is Client, Office Each Account is handled by exactly 1 Office Within a given Office, a given Client has exactly 1 Account  Violates BCNF! (account not a superkey) FDs: Client, Office  Account Account  Office Splitting into 1. Account,Office and 2. Client Loses correspondence between clients, offices, and accounts Redundancy!

Third Normal Form vs. BCNF This is a minimal example of a table in “third normal form” (3NF) but not BCNF All tables in BCNF are also in 3NF But 3NF allows redundancy to “preserve FDs” – Meaning that all FDs can be checked in a single table AccountClientOffice AJoe1 BMary1 AJohn1 CJoe2 FDs: Client, Office  Account Account  Office

Study Break Patient database Want to represent patients at hospitals with doctors Patients have names, birthdates Doctors have names, specialties Hospitals have names, addresses One doctor can treat multiple patients, each patient has one doctor Each patient in one hospital, hospitals have many patients Doctors work for one hospital, hospitals have many doctors 1) Draw an ER diagram 2) What are the functional dependencies? 3) What is the normalized schema? Is it in BCNF?

Study Break (cont’d) Write a SQL statement for: – Getting the names of all patients seeing Dr. X – Determining the average # of patients per hospital – Tallying up the # of doctors practicing each specialty at each hospital

Database Internals Outline Front End Admission Control Connection Management (sql) Parser (parse tree) Rewriter (parse tree) Planner & Optimizer (query plan) Executor Query System Storage System Access Methods Lock Manager Buffer Manager Log Manager