Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.

Slides:



Advertisements
Similar presentations
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Advertisements

Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design: Normalization.
Normalization I.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
1 5 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 5 Database Design 1: Normalization.
Introduction to Schema Refinement
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Chapter 4: Logical Database Design and the Relational Model (Part II)
Week 6 Lecture Normalization
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
Chapter 6 Normalization 正規化. 6-2 In This Chapter You Will Learn:  更動異常  How tables that contain redundant data can suffer from update anomalies ( 更動異常.
Avoiding Database 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,
Concepts of Database Management, Fifth Edition
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: >
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
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.
Normalization Transparencies
Schema Refinement and Normal Forms 20131CS3754 Class Notes #7, John Shieh.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Chapter 13 Normalization Transparencies. 2 Chapter 13 - Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification.
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.
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,
IST Database Normalization Todd Bacastow IST 210.
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.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
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.
ITD1312 Database Principles Chapter 4C: Normalization.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
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.
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.
Normalization DBMS.
Functional Dependencies
Payroll Management System
Chapter 14 Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Database Normalization
Chapter 14 Normalization – Part I Pearson Education © 2009.
Normalization Dale-Marie Wilson, Ph.D..
Normalization.
Chapter 14 Normalization.
Chapter 14 Normalization.
Normalization February 28, 2019 DB:Normalization.
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Database Normalisation
Presentation transcript:

Introduction to Schema Refinement

Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies Deletion Anomalies Insertion Anomalies

Introduction to Schema Refinement Data Redundancy Storing the information repeatedly, that is, in more than one place within a database, can lead to several problems Redundancy leads to inconsistency Inconsistency generate problem in insertion, deletion and updating

Introduction to Schema Refinement Problems Caused by Redundancy Update Anomalies: If one copy of such repeated data is updated, an inconsistency is created unless all copies similarly updated. Insertion Anomalies: It is not be possible to store certain information unless some other, unrelated, information is stored as well. Deletion Anomalies: It may not be possible to delete certain information without losing other, unrelated, information as well.

Introduction to Schema Refinement Data Redundancy In the student relation there are information is repeated several times Update Anomalies: If we change the name ‘Ravi’, it affects all 2 rows having sname information too Deletion Anomalies: Deleting row 2 result in loss of AAA college from the whole relation Insertion Anomalies: Cannot add a row which does not have value SidSnameCourseColleg 100RaviCSEABC 101VijayMCAAAA 102SajiEEEBBB 103RaviECCCC

Introduction to Schema Refinement Null Values Null value leads to wastage of memory space Null value have multiple interpretations, such as The attribute does not apply to this tuple. The attribute value for this tuple is unknown. The value is known but absent; that is, it has not been recorded yet.

Introduction to Schema Refinement The Process of Normalisation Normalisation is a data analysis technique to design a database system. It allows the database designer to understand the current data structures in an organisation. Furthermore, it aids any future changes and enhancements to the system. Normalisation is a technique for producing relational schema with the following properties: No Information Redundancy No Update Anomalies

Functional dependency It play a main role in designing good database design from bad database design A functional dependency (FD) is a constraint between two sets of attributes in a relation Describes the relationship between attributes in a relation. If A and B are attributes of a relation R, B is functionally dependent on A (denoted. A → B), if each value of A in R is associated with exactly one value of B in R.

Functional dependency A → B Determinant: attribute or set of attributes on the left hand side of the arrow. In the above example A is determinant Determinant may be attribute or group of attribute

Functional dependency From the relation Customer Cid  Cname Because Cid is the primary key of the table It is always unique So Cid uniquely determines the customer name even in the case of duplicate Cname So Cname is functionally dependent to Cid Cname  cid It is not always true Because name of the customer may be same for different Cid So Cname not uniquely determines the customer Cid  age true Cid  salary true Age  Cid false CidCnameAgeSalary 101Jeet Seet Swet Abc235000

Functional dependency Unnormalized form (UNF): A table that contains one or more repeating groups. Repeating group: an attribute or group of attributes within a table that occurs with multiple values in a single row An unnormalized relation contains non atomic values Example The row corresponding to Jeet Have more than one phone no So this table is unnormalized relation CidCnamePhone 101Jeet Seet44 103Swet34 104Abc23

Functional dependency First normal form (1NF): A relation in which the each row and column contains one and only one value. Is does not contain multivalued attribute Every attribute value is atomic Ie all cells are single values A relation is in 1NF if and only if all underlying domains contain atomic values only Or One value is associated with each attribute

Functional dependency Converting UNF to 1NF Remove repeating groups(multivalue) Entering appropriate data in the empty columns of rows. For each repeating field value, create a new tuple CidCnamePhone 101Jeet Jeet Seet44 103Swet34 104Abc23 CidCnamePhone 101Jeet Seet44 103Swet34 104Abc23

Functional dependency Types of FD Full FD Partial Dependency Transitive Dependency Trival and Non-Trival Dependencies

Functional dependency Types of FD Full FD For a relation schema R and FD X  Y, Y is fully functional dependent on X if there is no Z, where Z is the proper subset of A, such that Z  Y Or X  Y is a full FD if the removal of any attribute A from X removes the dependency

Functional dependency Types of FD Full FD An attribute is fully functionally dependent on a set of attributes X if it is Functionally dependent on X, and Not functionally dependent on any proper subset of X.

Functional dependency Types of FD Partial Dependency A FD X  Y is partial dependency if some attribute A can be removed from X and the dependency sill hold for some attribute, then that dependency is called partial dependency Or if there is some attribute that can be removed from A and the dependency still holds. Example {Cid, Phone}  Cname Is partial because Cid  Cname Is full FD CidCnamePhone 101Jeet Jeet Seet44 103Swet34 104Abc23

Functional dependency Types of FD Transitive dependency: 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). Is X  Y Y  Z Then X  Z

Functional dependency Types of FD Trival & Non Trival Dependency Some FD are said to be trival, because they are satisfied by all relations Example A  is satisfied by all relations involving attribute A Similarly AB  A is satisfied by all relations involving attribute A FD is trival if right hand side is a subset of the left hand side Non-trival dependency are one that is not trival X  Y is non trival if and only if Y X Example Car(carno,carname,color,weight) FD of the relation car is Carno  carname Carno  color