INFO 340 Lecture 7 Functional Dependency, Normalization.

Slides:



Advertisements
Similar presentations
Database Design: Normalization J.G. Zheng June 29 th 2005 DB Chapter 4.
Advertisements

The Relational Model System Development Life Cycle Normalisation
Systems Development Life Cycle
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Data Management Design
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 I.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
1 Minggu 10, Pertemuan 19 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
LOGICAL DATABASE DESIGN
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
DBSQL 4-1 Copyright © Genetic Computer School 2009 Chapter 4 Database Design.
Lecture 12 Inst: Haya Sammaneh
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Chapter 6 Normalization 正規化. 6-2 In This Chapter You Will Learn:  更動異常  How tables that contain redundant data can suffer from update anomalies ( 更動異常.
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 13 Normalization Transparencies. 2 Last Class u Access Lab.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Normalization Transparencies
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Chapter 13 Normalization © Pearson Education Limited 1995, 2005.
Lecture 5 Normalization. Objectives The purpose of normalization. How normalization can be used when designing a relational database. The potential problems.
Chapter 13 Normalization Transparencies Last Updated: 08 th May 2011 By M. Arief
Chapter 10 Normalization Pearson Education © 2009.
1 Functional Dependencies and Normalization Chapter 15.
Functional Dependency, Normalization
Normalization Transparencies 1. ©Pearson Education 2009 Objectives How the technique of normalization is used in database design. How tables that contain.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u How to undertake process of normalization. u How to identify most commonly used normal.
Lecture Nine: Normalization
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
© Pearson Education Limited, Normalization Bayu Adhi Tama, M.T.I. Faculty of Computer Science University of Sriwijaya.
9/23/2012ISC329 Isabelle Bichindaritz1 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,
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Logical Database Design and the Relational Model.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Lecture 4: Logical Database Design and the Relational Model 1.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
NormalisationNormalisation Normalization is the technique of organizing data elements into records. Normalization is the technique of organizing data elements.
Normalization ACSC 425 Database Management Systems.
ITD1312 Database Principles Chapter 4C: Normalization.
Databases Introduction - concepts. Concepts of Relational Databases.
NORMALIZATION.
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.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
Normalization.
Chapter 14 Normalization
Database Normalization
Chapter 14 Normalization – Part I Pearson Education © 2009.
Normalization Dale-Marie Wilson, Ph.D..
Chapter 14 Normalization.
Chapter 14 Normalization.
Normalization February 28, 2019 DB:Normalization.
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Relational Database Design
Presentation transcript:

INFO 340 Lecture 7 Functional Dependency, Normalization

DeMorgan’s Theorem A AND B = A OR B A OR B = A AND B

“Spreadsheet Syndrome” When you use a spreadsheet program, you only really have one table. This leads to duplication of data.

Normalization Goal: Every non-key column is directly dependent on the key, the whole key, and nothing but the key Goal: Reduce redundancies, less anomalies, and improve efficiency.

Data Redundancy & Update Anomalies Insertion Anomaly – Staff # | sName | position | salary | branch# | bAddress Add new staff & bAddress must be updated also – creating opportunity for error Want to add new branch w/no staff means we have to enter nulls for staff members Deletion Anomaly Deleting last staff member of a branch also deletes details on branch Modification Anomaly Updating details of a particular branch must be done for all rows – creating opportunity for error

Functional Dependency & Normalization How to identify the most commonly used normal forms, namely First Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF).

What happens if normalization hasn’t occurred? Data duplication Multiple truths Difficulty to query

Full functional dependency A fully functional dependency is when you can not remove items from the first set (the A in A  B) and maintain a functional dependency.

Transitive Dependency Transitive dependency describes a condition where A, B, and C are attributes of a relation such that if A → B and B → C, then C is transitively dependent on A via B (provided that A is not functionally dependent on B or C).

Functional Dependency & Normalization Main characteristics of functional dependencies used in normalization: – There is a one-to-one relationship between the attribute(s) on the left-hand side (determinant) and those on the right-hand side of a functional dependency. – Holds for all time. – The determinant has the minimal number of attributes necessary to maintain the dependency with the attribute(s) on the right hand-side.

Normalization Formal technique for analyzing a relation based on its primary key and the functional dependencies between the attributes of that relation. Formal method to cross-check your work – “sanity check” Often executed as a series of steps. Each step corresponds to a specific normal form, which has known properties. As normalization proceeds, the relations become progressively more restricted (stronger) in format and also less vulnerable to update anomalies.

1 st Normalized Form A relation in which the intersection of each row and column contains one and only one value. Atomicity. Based upon you’re requirements, a column holds only one value.

2 nd Normal Form Based on the concept of full functional dependency. A relation that is in 1NF and every non- primary-key attribute is fully functionally dependent on the primary key.

2NF examples StudentClassLocation JohnCSE 143EEB 103 JohnEE 131EEB 103 SusieINFO 340MGH 238 SusieMATH 124PAR 104 SusieEE 131EEB 103 While in 1NF form, it is not in 2NF form. Candidate Key {Student,Class}. Location is not fully functional dependent, since it is dependent only on Class. StudentClass JohnCSE 143 JohnEE 131 SusieINFO 340 SusieMATH 124 SusieEE 131 ClassLocation CSE 143EEB 103 EE 131EEB 103 INFO 340MGH 238 MATH 124 PAR 104

3 rd Normal Form Based on the concept of transitive dependency. A relation that is in 1NF and 2NF and in which no non-primary-key attribute is transitively dependent on the primary key.

3NF example PublisherIDNameAddressCityStateZIP 1Apress2560 Ninth Street, Station 219BerkeleyCA94710 Looks good, but notice that City and State are really dependent on ZIP, not Publisher_ID. A good way to find transitive functional dependencies is think to yourself. – “If I update this column, do I need to update others?” In this case, updating the City column would require you to update the ZIP and possible the State column. This example, though, hints that one of the dangers of normalization, that you can sometimes go too far.. PublisherIDNameAddressZIP 1Apress2560 Ninth Street, Station ZIPCityState 94710BerkeleyCA

MidTerm Overview Limitations of file-based systems Difference in a DDL & DML Advantages/disadvantages of DBMS’s Differences in External, Conceptual, & Internal levels of DBMS’s Data independence Functions of a DBMS Relation, attribute, domain,cardinality, degree Attribute domains Cartesian product Properties of a relation Keys – super, candidate, primary, foreign Null Entity integrity, referential integrity Sets – union, intersection, difference Joins – inner, right outer, left outer SQL – selects, updates, inserts, aggregates, group by, order by Wild cards Nested query DeMorgan’s Theorem in an SQL query Relational algebra – difference between a selection & a projection Entity relationship diagrams Mulitplicity Functional dependency Definitions of First, Second, & Third Normal form Be able to identify if a relation is in 1NF, 2NF, or 3NF Difference between Integer types in MySQL

Homework Complete Mini-Project work Prepare for mid-term