Functional dependencies 1. 2 Outline motivation: update anomalies cause: not expressed constraints on data (FDs) functional dependencies (FDs) definitions.

Slides:



Advertisements
Similar presentations
Fourth normal form: 4NF 1. 2 Normal forms desirable forms for relations in DB design eliminate redundancies avoid update anomalies enforce integrity constraints.
Advertisements

5NF and other normal forms
1 Term 2, 2004, Lecture 3, NormalisationMarian Ursu, Department of Computing, Goldsmiths College Normalisation 5.
Relational data integrity
Dependency preservation, 3NF revisited and BCNF
Normal forms - 1NF, 2NF and 3NF
1 Term 2, 2004, Lecture 2, Normalisation - IntroductionMarian Ursu, Department of Computing, Goldsmiths College Normalisation Introduction.
1 Term 2, 2007, Lectures 2/3, NormalisationD. Tidhar (based on M. Ursu) Department of Computing, Goldsmiths College Normalisation 5.
Functional Dependencies and Normalization for Relational Databases
Shantanu Narang.  Background  Why and What of Normalization  Quick Overview of Lower Normal Forms  Higher Order Normal Forms.
Normalisation to 3NF Database Systems Lecture 11 Natasha Alechina.
Chapter 11 Functional Dependencies. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.11-2 Topics in this Chapter Basic Definitions Trivial.
Normalisation The theory of Relational Database Design.
The Relational Model System Development Life Cycle Normalisation
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Normalization I.
Decomposition By Yuhung Chen CS157A Section 2 October
7-1 Normalization - Outline  Modification anomalies  Functional dependencies  Major normal forms  Practical concerns.
Data Modeling and Database Design
Databases 6: Normalization
Functional Dependencies Jorge Pombar. Definitions Functional dependencies are the building blocks that enable the analysis of data redundancy and the.
Chapter 14 Advanced Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
Functional Dependencies Prof. Yin-Fu Huang CSIE, NYUST Chapter 11.
FUNCTIONAL DEPENDENCIES
Introduction to Normalization CPSC 356 Database Ellen Walker Hiram College.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Logical Database Design ( 補 ) Unit 7 Logical Database Design ( 補 )
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
Chapter 7 Normalization. Outline Modification anomalies Functional dependencies Major normal forms Relationship independence Practical concerns.
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
Chapter 7 Normalization. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Modification anomalies Functional dependencies.
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.
CSC271 Database Systems Lecture # 28.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
CS 338Database Design and Normal Forms9-1 Database Design and Normal Forms Lecture Topics Measuring the quality of a schema Schema design with normalization.
Ch 7: Normalization-Part 1
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
ITD1312 Database Principles Chapter 4C: Normalization.
Copyright © Curt Hill Schema Refinement II 2 nd NF to 3 rd NF to BCNF.
Advanced Database System
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Normalization.
Normalization (Database Design)
Advanced Normalization
CS422 Principles of Database Systems Normalization
A brief summary of database normalization
Normalization First Normal Form (1NF) Boyce-Codd Normal Form (BCNF)
CS422 Principles of Database Systems Normalization
Relational Database Design by Dr. S. Sridhar, Ph. D
Advanced Normalization
Fourth normal form: 4NF.
Module 5: Overview of Normalization
Schema Refinement What and why
Unit 7 Normalization (表格正規化).
Lecture 07: E/R Diagrams and Functional Dependencies
Normalisation to 3NF.
Minggu 9, Pertemuan 18 Normalization
Designing Relational Databases
Relational Database Design
Database.
Chapter 7a: Overview of Database Design -- Normalization
Presentation transcript:

Functional dependencies 1

2 Outline motivation: update anomalies cause: not expressed constraints on data (FDs) functional dependencies (FDs) definitions examples concepts and terminology (more) advanced theoretical issues (in brief)

Functional dependencies 3 Redundancy Student-Modules

Functional dependencies 4 Update anomalies - insertion insert the fact that takes Networks - Introduction; the name of the student and the name of the personal tutor have to be entered as well; this is prone to errors inconsistent data can you identify other kinds of update anomalies on this relation?

Functional dependencies 5 Update anomalies - deletion delete the fact that takes HCI, in the original table; relevant information will be also deleted - about T.A Flo and about HCI.

Functional dependencies 6 Update anomalies - modification it is possible to modify an attribute and to bring the relation in an inconsistent state; e.g. it is possible (e.g. by mistake) to modify the value of Database Systems to 1/2cu in just some rows; such situations must be avoided

Functional dependencies 7 Cause … of anomalies redundancy … of redundancy constraints on data that are not considered or expressed in the relational model (or, more specifically, on for a particular relation) (some of) these constraints are called Functional Dependencies (FDs) –(others: multiple dependencies, …)

Functional dependencies 8 To eliminate the problem express the existing functional dependencies this is done by choosing particular forms for relations - normal forms a relation is in a certain normal form if if it does not contain certain kinds of functional dependencies a relation in a certain normal form eliminates certain kinds of update anomalies a relation that is not in a certain normal form can be transformed (decomposed) into an equivalent set of relations - this process is called normalisation

Functional dependencies 9 Functional dependency (FD) R - relation, X and Y - subset of attributes of R X Y iff in every possible legal value of R each X-value has a single Y-value associated time independent (for all time)

Functional dependencies 10 Examples S_id S_name S_id P_Tutor S_id (S_id, P_tutor) P_tutor (S_id, S_name, P_tutor) P_tutor Module Val (S_id, Module) Res (S_id, S_name, P_tutor, Module, Val) Res

Functional dependencies 11 Concepts FD is a semantic concept determinant / dependent trivial / non-trivial FD left-irreducible yes: (S_id, P_tutor) P_tutor no: (S_id, Module) Res closure irreducible set

Functional dependencies 12 Functional diagram S_id City P_tutor S_name S_id Module Res Module

Functional dependencies 13 Closure all FDs that can be derived from a given set S notation S+ Armstrongs inference rules if B A then A B if A B then AC BC if A B and B C then A C sound and complete –other rules can be inferred (make the derivation process easier) –A BC iff A B and A C –A B and C D then AC BD

Functional dependencies 14 Irreducible set S 1 covers S 2 iff S 2 + S 1 + S is irreducible iff RHS of every FD is non-composite all FDs in S are left-irreducible no FD ca be discarded from S without changing S + a database that enforces S enforces, in fact, S + the irreducible set of S is S iff S - irreducible S + = S + more efficient to work with the irreducible set

Functional dependencies 15 Conclusion 2NF, 3NF and BCNF will be defined based on FDs