Relational Data Analysis Learning outcomes  understand the process of normalisation;  perform Relational Data Analysis;  recognise the importance of.

Slides:



Advertisements
Similar presentations
Copyright: ©2005 by Elsevier Inc. All rights reserved. 1 Author: Graeme C. Simsion and Graham C. Witt Chapter 3 The Entity-Relationship Approach.
Advertisements

Normalisation.
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
 Definition  Components  Advantages  Limitations Contents  Definition Definition  Normal Forms Normal Forms  First Normal Form First Normal Form.
RJP/RDA 1 /93 Relational Data Analysis (RDA) RDA organises all the system’s data items into a set of well NORMALISED relations. These should avoid: 1.
Normalisation Ensuring data integrity in database design 1.
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Normalization of Database Tables
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Function Definition  From Investigation to Specification  Defining Functions  The Universal Function Model  Identifying and Documenting Functions.
Chapter 5 Normalization Transparencies © Pearson Education Limited 1995, 2005.
Chapter 5 Normalization of Database Tables
Project and Data Management Software
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
System Analysis and Design
July 14, 2015ICS 424: recap1 Relational Database Design: Recap of ICS 324.
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 3 Objectives: Identifying and Eliminating Database.
Modelling Techniques - Normalisation Description and exemplification of normalisation.Description and exemplification of normalisation. Creation of un-normalised.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
SQL Normalization Database Design Lecture 5. Copyright 2006Page 2 SQL Normalization Database Design 1 st Normal Form 1 st Normal Form 2 nd Normal Form.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Concepts and Terminology Introduction to Database.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Richard Merritt1 Data Modelling Entities, Attributes and Relationships.
Database Systems: Design, Implementation, and Management Tenth Edition
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
Normalization Transparencies
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
1 5 Normalization. 2 5 Database Design Give some body of data to be represented in a database, how do we decide on a suitable logical structure for that.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Object-Relational Modeling. What Is a Relational Data Model? Based on the concept of relations (tables of data) Relationships established by matching.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Chapter 10 Normalization Pearson Education © 2009.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Normalisation RELATIONAL DATABASES.  Last week we looked at elements of designing a database and the generation of an ERD  As part of the design and.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
6-1 © Prentice Hall, 2007 Topic 6: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
8-1 © Prentice Hall, 2007 Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
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 Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
MS Access. Most A2 projects use MS Access Has sufficient depth to support a significant project. Relational Databases. Fairly easy to develop a good user.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Relational Databases – Further Study I think we’ve covered all you need to know for GCSE about relational databases I’m not aware of any practical coursework.
Normalizing Database Designs. 2 Objectives In this chapter, students will learn: –What normalization is and what role it plays in the database design.
Logical Design & the Relational Model
A brief summary of database normalization
Chapter 9 Designing Databases
System Analysis and Design
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Presentation transcript:

Relational Data Analysis Learning outcomes  understand the process of normalisation;  perform Relational Data Analysis;  recognise the importance of normalised databases;  recognise first, second and third normal forms;  augment and formalise your understanding of Logical Data Modelling;  decide when in the development cycle to perform normalisation;  evaluate the integrity of a data structure.

Relational Data Analysis Concepts  Relations, Tables and Entity Types  Repeating Groups and Levels  Functional Dependencies  Advantages of Normalisation  Unnormalised Data  First, Second and Third Normal Forms  Rationalising 3NF Tables  Converting 3NF Tables into an LDS

Relational Data Analysis Relations and Tables 1970s Edgar Codd IBM Supplier NameSupplier AddressSupplier Tel. No. Sup Con SRW115 Lancelot St John Off Beat Recordings 12 High St020-8…... Bella SonicLake Industrial Estate... Supplier Number …3 Lot’s Corner... RowsRows Columns Attribute Names Primary Key

Relational Data Analysis Tables and Entity Types Supplier Supplier Number Supplier Name Supplier Address Supplier Tel. Number Supplier Contact Name Supplier Supplier Number Supplier Name Supplier Address Supplier Tel. Number Supplier Contact Name SUPPLIER (Supplier Number, Supplier Name, Supplier Address,Supplier Tel. Number, Supplier Contact Name)

Relational Data Analysis Repeating Groups and Levels Product’s Suppliers List Product Number: Product Name: Unbranded Blank 3hr Video Tapes Product Type Code: BV Product Type Name: Blanc Video Supplier Supplier Supplier’s Cost Main Supplier Number Name Product Ref No Price Y/N 1463 SRW 3HVHS 54p Y 3628 Videos Are Us p N 2327 Bella Sonic 3485VHS/3 53p N Product’s Suppliers List Product Number: Product Name: Unbranded Blank 3hr Video Tapes Product Type Code: BV Product Type Name: Blanc Video Supplier Supplier Supplier’s Cost Main Supplier Number Name Product Ref No Price Y/N 1463 SRW 3HVHS 54p Y 3628 Videos Are Us p N 2327 Bella Sonic 3485VHS/3 53p N

Relational Data Analysis Repeating Groups and Levels PRODUCT’S SUPPLIERS Product Number Product Name Product Type Code Product Type Name Supplier Number Supplier Name S/P Ref. Number Cost Price Main Supplier Y/N level 1 2

Relational Data Analysis Functional Dependencies  An attribute X is said to be functionally dependent on an attribute Y if each value of Y is associated with only one value of X  For example, each product is of one product type. This means that each product number is associated with only one product type code. Product type code is therefore functionally dependent on product number. The opposite is not true as each product type code may be associated with many product numbers

Relational Data Analysis Functional Dependencies  Another way of phrasing functional dependency is to say that the value of X can be determined from the value of Y, or that Y functionally determines X  So product number functionally determines the value of product type code, or the value of product type code can be determined from the value of the product number, i.e. given the value of a product number we can always establish the value of the associated product type code.

Relational Data Analysis Normalisation  The process of normalisation involves applying a series of refinements to groups of data items in order to produce tables that conform to specified standards, known as normal forms  Unnormalised tables are converted to First Normal Form by removing repeating groups into separate tables. Second and Third Normal Forms are achieved by reducing and splitting tables so that the only functional dependencies which exist are between the primary keys and the remaining non-key attributes.

Relational Data Analysis Advantages of Normalisation  Before describing normalisation in detail it is worth mentioning some of its advantages briefly. Data in Third Normal Form (3NF) consists of tables of closely associated attributes which are entirely dependent on ‘the key, the whole key, and nothing but the key’  This has the effect of minimising data duplication across different tables, thereby resolving many of the problems associated with data redundancy. In particular it should reduce the incidence of ‘update anomalies’

Relational Data Analysis Advantages of Normalisation  Update anomalies is the collective term for problems with modifying, inserting and deleting data from a database  These can be illustrated by considering the ‘unnormalised’ contents of the list of a product’s suppliers again  If we were to implement this data structure as it stands, and to use it as the only place in which product details were stored we would encounter the following problems:

Relational Data Analysis Advantages of Normalisation  Insertion Anomalies. No new suppliers could be added to the system without adding a product  Deletion Anomalies. If the last remaining product for a given supplier were deleted, then all information on that supplier would be lost  Amendment Anomalies. Any change to a supplier’s details (e.g. to the telephone number) would mean that every product for that supplier would need amending to keep it in line.

Relational Data Analysis UNF to 1NF Product Number Product Name Product Type Code Product Type Name Supplier Number Supplier Name S/P Ref. Number Cost Price Main Supplier Y/N 1 2 UNF Choose data items Identify keys Split groups level Product Number Product Name Product Type Code Product Type Name Product Number Supplier Number Supplier Name S/P Ref. Number Cost Price Main Supplier Y/N 1NF Note key

Relational Data Analysis 1NF to 2NF 1NF Does this attribute depend on the whole of the primary key? Product Number Product Name Product Type Code Product Type Name 2NF Product Number Product Name Product Type Code Product Type Name Product Number Supplier Number Supplier Name S/P Ref. Number Cost Price Main Supplier Y/N Product Number Supplier Number S/P Ref. Number Cost Price Main Supplier Y/N Supplier Number Supplier Name

Relational Data Analysis 2NF to 3NF 2NF Is this attribute dependent on any other non- key attribute(s)? Product Number Product Name *Product Type Code Product Type Code Product Type Name 3NF Product Number Product Name Product Type Code Product Type Name Product Number Supplier Number S/P Ref. Number Cost Price Main Supplier Y/N Supplier Number Supplier Name Product Number Supplier Number S/P Ref. Number Cost Price Main Supplier Y/N Supplier Number Supplier Name Note foreign key

Relational Data Analysis Naming the 3NF tables 3NF PRODUCT PRODUCT TYPE SUPPLIER PRODUCT SUPPLIER Table Names Product Number Product Name *Product Type Code Product Type Code Product Type Name Product Number Supplier Number S/P Ref. Number Cost Price Main Supplier Y/N Supplier Number Supplier Name

Relational Data Analysis Rationalising 3NF tables  Once we have carried out normalisation on a number of Functions we will have several sets of tables in 3NF, which we now rationalise into a single, larger set  Any tables that share a primary key should be merged, as should tables with matching candidate keys  We will also look for attributes which now act as foreign keys when compared with primary keys in other 3NF sets. A little care is needed to ensure that any synonyms or homonyms are identified, as failure to do so could lead to missing or spurious merges.

Relational Data Analysis Converting 3NF tables into LDSs 3NF PRODUCT Product Number Product Name *Product Type Code Product Type Code Product Type Name Product Number Supplier Number S/P Ref. Number Cost Price Main Supplier Y/N Supplier Number Supplier Name PRODUCT Product Number *Product Type Code PRODUCT TYPE Product Type Code SUPPLIER Supplier Number SUPPLIER PRODUCT *Supplier Number *Product Number PRODUCT TYPE SUPPLIER PRODUCT SUPPLIER Small Keys Grab Large Keys Crows Feet Grab Asterisks Represent each table as an entity type box List primary and foreign key attributes

Relational Data Analysis Comparing LDSs  We now compare our two data structures (the extract we just produced using RDA with the Required System LDM we have produced earlier in the development and decide whether any discrepancies are due to errors in Logical Data Modelling or whether they represent redundant information resulting from RDA  In practice there may be large numbers of entities involved in the comparison, so a fair amount of time is likely to be spent in identifying corresponding entities in the two models. Probably the best starting point is to look for common attributes, in particular common primary keys or candidate keys.

Relational Data Analysis Summary  Relational Data Analysis (RDA) is based on material published in the 1970s by Edgar Codd of IBM, proposing the application of mathematical set theory and algebra to the organisation of data  RDA is used to create data model extracts from collections of individual data items, which can then be used to enhance or confirm the Required System LDM and to provide the basis for database design

Relational Data Analysis Summary  The process of normalisation involves applying a series of refinements to groups of data items in order to produce tables that conform to specified standards, known as normal forms ‘the key, the whole key, and nothing but the key’  Data in Third Normal Form (3NF) consists of tables of closely associated attributes which are entirely dependent on ‘the key, the whole key, and nothing but the key’. This has the effect of minimising data duplication across different tables, thereby resolving many of the problems associated with data redundancy

Relational Data Analysis Summary  Finally, the only way to learn normalisation is to practise.  This is specially true in order to understand the process of rationalisation and how to compare LDSs

The Place of Relational Data Analysis Decision Structure Policies and Procedures User Organisation Investigation Construction Specification Conceptual Model Internal design External Design BAM RD WPM DFM FD LDM RDA BSO