Database Design Dr. M.E. Fayad, Professor

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Schema Refinement and Normal Forms Given a design, how do we know it is good or not? What is the best design? Can a bad design be transformed into a good.
L3-5c-S1 Object Diagrams © M.E. Fayad SJSU -- CmpE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department,
L16-S1 Object Diagrams 2003 SJSU -- CmpE Software Patterns Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering.
L19-S1 More on Class Diagrams 2003 SJSU -- CmpE Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
L3-5d-S1 Class Diagrams © M.E. Fayad SJSU -- CmpE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
© M.E. Fayad SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José.
L5-S1 Class Diagrams 2003 SJSU -- CmpE Software Patterns Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San.
Department of Computer Science and Engineering, HKUST Slide 1 7. Relational Database Design.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
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.
Functional Dependencies and Normalization for Relational Databases
L8-2-S1 Misc Topics © M.E. Fayad SJSU -- CmpE Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
Normalization and FUNctional Dependencies. Redundancy: root of several problems with relational schemas: –redundant storage, insert/delete/update anomalies.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
COP 6726: New Directions in Database Systems
Functional Dependency and Normalization
Advanced Normalization
Gergely Lukács Pázmány Péter Catholic University
A brief summary of database normalization
Module 5: Overview of Database Design -- Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Normalization First Normal Form (1NF) Boyce-Codd Normal Form (BCNF)
CPSC-310 Database Systems
Relational Database Design by Dr. S. Sridhar, Ph. D
Relational Database Design
CS 480: Database Systems Lecture 22 March 6, 2013.
Lecture 4 Database design IV Normal Forms: Summary.
Chapter 8: Relational Database Design
3.1 Functional Dependencies
Advanced Normalization
Relational Design Theory
Fourth normal form: 4NF.
Functional Dependencies and Normalization
Schema Refinement and Normalization
Database Management systems Subject Code: 10CS54 Prepared By:
Module 5: Overview of Normalization
Chapter 7: Relational Database Design
Normalization Murali Mani.
Normalization Boyce-Codd Normal Form Presented by: Dr. Samir Tartir
Lecture #17: Schema Refinement & Normalization - Normal Forms
Functional Dependencies and Normalization
Database solutions The process of normalization Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms:
Functional Dependencies and Normalization
Normalization Dale-Marie Wilson, Ph.D..
Outline: Normalization
Relational Data Base Design in Practice
Relational Design Theory
Normalization Part II cs3431.
CS 405G: Introduction to Database Systems
Instructor: Mohamed Eltabakh
Relational Database Design
Designing Relational Databases
Lecture 5: Functional dependencies and normalization
Relational Database Design
Instructor: Mohamed Eltabakh
Anomalies Boyce-Codd Normal Form 3rd Normal Form
Database Design Dr. M.E. Fayad, Professor
Database Design Normalisation (2)
Chapter 7a: Overview of Database Design -- Normalization
Functional Dependencies and Normalization
Functional Dependencies and Normalization
CS4222 Principles of Database System
Presentation transcript:

Database Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad 2003 SJSU -- CmpE

Lesson 10: Normalization 2 2003 SJSU – CmpE --- M.E. Fayad

3 Lesson Objectives Understand the goals of normalization Explore the problems of DB bad design Understand normalization Learn how to deal with normalization 3 2003 SJSU – CmpE --- M.E. Fayad

Relational Database Design Goals: Reduce data redundancy (undesirable replication of data values) Minimize anomaly problems (data model is structured in an improper manner) Maintain (correct) information Enforce semantic & integrity constraints, e.g., using dependency & domain constraints 4 2003 SJSU – CmpE --- M.E. Fayad

Problems of Bad DB Design Data replication: extra storage, update anomalies Anomaly: costly & data inconsistency Loss of information: poor decomposition Un-enforced dependency constraints: dependencies are lost 5 2003 SJSU – CmpE --- M.E. Fayad

6 Normalization A db scheme design tool A process of replacing associations among attributes in a relation scheme An approximation of the relation schemes that should be created Objectives: accomplish the goals of relational database design Two approaches: decomposition & synthesis 6 2003 SJSU – CmpE --- M.E. Fayad

Decomposition A process to split or decompose a relation until the resultant relations no longer exhibit the undesirable problems, e.g., data redundancy, data inconsistency, anomaly, etc. Decomposing a relation scheme R means breaking R into a pair of schemes, possibly intersecting + this process is repeated until all the decomposed relation schemes are in the desired (normal) form. 7 2003 SJSU – CmpE --- M.E. Fayad

8 Normal Forms (NFs) 1NF 2NF 3NF BCNF 4NF PJNF 2003 SJSU – CmpE --- M.E. Fayad

Normal Forms (NFs) restrictions on the db scheme that preclude certain undesirable properties (data redundancy, update anomaly, loss of information, etc.) from the DB. A relation scheme R is in PJNF if R is in 4NF if R is in BCNF if R is in 3NF if R is in 2NF if R is in 1NF 9 2003 SJSU – CmpE --- M.E. Fayad

Normal Forms (NFs) Definition. A data value v is atomic if v is not a (i) set of values or (ii) composite value; otherwise, v is non-atomic. First Normal Form (1NF). A relation scheme R is in 1NF if for every attribute A in R, the values in the domain of A, i.e., dom(A), are atomic. 10 2003 SJSU – CmpE --- M.E. Fayad

Normal Forms (NFs) Boyce-Codd Normal Form (BCNF). A relation scheme R is in BCNF if for every non-trivial FD X  Y applied to R, X is a superkey for R. Definition. Let A be an attribute in a relation scheme R, and let F be a set of FDs over R. A is a prime attribute in R if A is contained in some candidate key of R; otherwise, A is a non-prime attribute in R. 11 2003 SJSU – CmpE --- M.E. Fayad

Normal Forms (NFs) Third Normal Form (3NF). A relation scheme R is in 3NF if R is in 1NF, and For every non-trivial FD X  Y applied to R, either X is a superkey of R, or every attribute in Y is an attribute of some candidate key of R, i.e., prime. 12 2003 SJSU – CmpE --- M.E. Fayad

Normal Forms (NFs) Lossy decomposition: a decomposition is lossy if the natural join of all the decomposed relations contain additional tuples and the original relation is lost. Lossless decomposition: a decomposition is lossless if the natural join of all the decomposed relations always yields the original relation without any extra tuples, i.e., a decomposition {R1, R2, …, Rn} of R is lossless if r(R), r(R) = R1(r)  R2(r)  …  Rn(r) 13 2003 SJSU – CmpE --- M.E. Fayad

2-Relational lossless-join decomposition Let R1 and R2 be decomposed schemes of R. Let F be a set of FDs on R. The decomposition is lossless if R1  R2  R1  F+ or R1  R2  R2  F+ 14 2003 SJSU – CmpE --- M.E. Fayad

Dependency preserving a decomposition is dependency preserving if no dependency is lost in the process. Let F be the set of FDs on R. Let R1, … , Rn be a decomposition of R. Let Fi, 1  i  n, be the set of FDs in F+ which applies to Ri. Let F’ = i=1..n Fi. If F’+ = F+, then the decomposition is dependency preserving. 15 2003 SJSU – CmpE --- M.E. Fayad