1 An Introduction to Relational Data Analysis (Normalisation)

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
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.
Section 11 : Normalisation - A Worked Example
Normalisation Ensuring data integrity in database design 1.
Athabasca University Under Development for COMP 200 Gary Novokowsky
Modeling the Data: Conceptual and Logical Data Modeling
Normalisation “A formal technique for analysing relations based on their primary key and functional dependencies.” [Codd]. Process – Analyse each relation.
Normalisation up to 1NF Bottom-up Approach to Data Modelling.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Normalisation up to 1NF Bottom-up Approach to Data Modelling.
Relational Data Analysis II. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis Feasibility Maintenance.
Project and Data Management Software
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Introduction to Databases
Page 1 ISMT E-120 Desktop Applications for Managers Introduction to Microsoft Access.
Lecture 12 Inst: Haya Sammaneh
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.
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!
CBAD2103 Data Analysis and Modeling. Chapter 7 Conceptual Design Methodology.
Richard Merritt1 Data Modelling Entities, Attributes and Relationships.
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
A Normalisation Example Mark Kelly McKinnon Secondary College Vceit.com Based on work by Robert Timmer-Arends.
Normalisation Mia’s Sandwich Shop The Process Explained.
Bottom Up Analysis Bottom-up Data Analysis An Example.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Deanery of Business & Computer Sciences Transformation of Logical Diagram into Database Design Language Lecture 6 Database Technology Level.
University of Sunderland COMM2Q Unit 2 COMM2Q Lecture 2 HIS Application Building.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
Normalisation Rules and Practical Application Geoff Leese January 2010.
CORE 2: Information systems and Databases NORMALISING DATABASES.
1 Information Retrieval and Use Data Analysis & Data Modeling, Relational Data Analysis and Logical Data Modeling Geoff Leese September 2009.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
1 Transforming the Data Model into Relations (Tables) and Normalisation Students.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
Normalization Data Design - Mr. Ahmad Al-Ghoul
Chapter 56 Relational Database Design Compiled by Eddie Moorcroft.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Sample Table Standard Notation Entity name in uppercase
April 20022CS3X1 Database Design Normalisation (1) John Wordsworth Department of Computer Science The University of Reading Room.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
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.
Logical Database Design and Relational Data Model Muhammad Nasir
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
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 Unit 6: Databases. Just to recap  What is an Entity  What is an Attribute?
Starter Draw a mind map for topic 6 Databases. Objectives Revise topic CG3.6 Databases using various activities and ensure that topics covered are understood.
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
Normalisation Worked example for an Order Remember : The data should depend upon the key, the whole key and nothing but the key.
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
Flat file and relational databases Flat file database In a flat file database information is held in a single table. Student IDStudent name GenderDOBCourse.
Dr Gordon Russell, Napier University Normalisation 1 - V2.0 1 Normalisation 1 Unit 3.1.
SEEM3430: Information Systems Analysis and Design
Relational Model and ER Model: in a Nutshell
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Examples of normalization
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
Examples of normalization
Database Normalisation
BTEC ICT – Unit 18 With Mr Griffiths.
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Normalisation Un-normalised Data (UNF or 0NF) Data Attributes:
Presentation transcript:

1 An Introduction to Relational Data Analysis (Normalisation)

2 Steps in Normalisation 1.Un-normalised form 2.First Normal Form 3.Second Normal Form 4.Third Normal Form Relational Data Analysis

3 Relational Data Analysis Student Results Table

4 Relational Data Analysis Possible Entities in System COURSECOURSE STUDENTSTUDENT TUTORTUTOR GRADE?GRADE?

5 Relational Data Analysis Unnormalised Form: Table made up of ROWS and COLUMNSTable made up of ROWS and COLUMNS Rows grouped togetherRows grouped together Write table in unnormalised formWrite table in unnormalised form Choose unique KEY and underlineChoose unique KEY and underline

6 Relational Data Analysis Data Attributes Student CodeStudent Code Student NameStudent Name Date of BirthDate of Birth All REPEAT for a given value of COURSE CODE Tutor Code Tutor Code Tutor Name Tutor Name Grade Grade Result Result

7 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Title1 Student Code2 Student Name2 Date of Birth2 Tutor Code2 Tutor Name2 Grade2 Result2 Relational Data Analysis Normalisation Table

8 Any relation is in First Normal Form when it contains no repeating groups of dataAny relation is in First Normal Form when it contains no repeating groups of data Relational Data Analysis First Normal Form

9 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Code Course Title1 Course Title Student Code 2 Student Name2Course Code Date of Birth2 Student Code Tutor Code2Student Name Tutor Name2 Date of Birth Grade2 Tutor Code Result2Tutor Name Grade Result Relational Data Analysis Normalisation Table

10 Relational Data Analysis Normalisation Table UNFUNF1NF2NF3NF LEVEL Course Code 1Course Code Course Title 1Course Title Student Code 2 Student Name 2 Date of Birth 2 Tutor Code 2Course Code Tutor Name 2Student Code Grade 2Student Name Result2Date of Birth Tutor Code Tutor Name Grade Result

11 Relational Data Analysis Normalisation Table UNFUNF1NF2NF3NF LEVEL Course Code1Course Code Course Title1Course Title Student Code2 Student Name2 Date of Birth2 Tutor Code2Course Code Tutor Name2Student Code Grade 2Student Name Result 2Date of Birth Tutor Code Tutor Name Grade Result

12 Relational Data Analysis Normalisation Table UNFUNF1NF2NF3NF LEVEL Course Code1Course Code Course Title1Course Title Student Code2 Student Name2 Date of Birth2 Tutor Code2Course Code Tutor Name2Student Code Grade 2Student Name Result 2Date of Birth Tutor Code Tutor Name Grade Result

13 Any relation already in 1NF is also in 2NF if EITHER the key is a single attribute OR the non-key items are fully dependent on the WHOLE keyAny relation already in 1NF is also in 2NF if EITHER the key is a single attribute OR the non-key items are fully dependent on the WHOLE key In Second Normal Form, you remove data items which depend on only part of a keyIn Second Normal Form, you remove data items which depend on only part of a key Relational Data Analysis Second Normal Form

14 Relational Data Analysis Student CodeStudent Name Student Code Tutor Code Course Code

15 Relational Data Analysis Student Name Date of Birth Course CodeTutor Code Student CodeTutor Name Grade Result

16 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Code Course Code Course Title1 Course Title Course Title Student Code 2 Student Name2Course CodeCourse Code Date of Birth2 Student CodeStudent Code Tutor Code2Student NameTutor Code Tutor Name2 Date of BirthTutor Name Grade2 Tutor CodeGrade Result2Tutor NameResult Grade ResultStudent Code Student Name Date of Birth Relational Data Analysis Normalisation Table - 2NF

17 Any relation in 2NF is also 3NF if all non-key attributes are independent of all other non-key attributes and all key attributes are independent of all the other key attributesAny relation in 2NF is also 3NF if all non-key attributes are independent of all other non-key attributes and all key attributes are independent of all the other key attributes In Third Normal Form, you remove any attributes which are not directly dependentupon the keyIn Third Normal Form, you remove any attributes which are not directly dependentupon the key Relational Data Analysis Third Normal Form

18 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Code Course CodeCourse Code Course Title1 Course Title Course TitleCourse Title Student Code 2 Student Name2Course CodeCourse CodeCourse Code Date of Birth2 Student CodeStudent CodeStudent Code Tutor Code2Student NameTutor CodeTutor Code Tutor Name2 Date of BirthTutor NameGrade Grade2 Tutor CodeGrade Result2Tutor NameResultStudent Code GradeStudent Name ResultStudent CodeDate of Birth Student Name Date of BirthTutor Code Tutor Name Grade Result Relational Data Analysis Normalisation Table - 3NF

19 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Code Course CodeCourse Code Course Title1 Course Title Course TitleCourse Title Student Code 2 Student Name2Course CodeCourse CodeCourse Code Date of Birth2 Student CodeStudent CodeStudent Code Tutor Code2Student NameTutor Code*Tutor Code Tutor Name2 Date of BirthTutor Name*Grade Grade2 Tutor CodeGrade Result2Tutor NameResultStudent Code GradeStudent Name ResultStudent CodeDate of Birth Student Name Date of BirthTutor Code Tutor Name Grade Result Relational Data Analysis Normalisation Table - 3NF Foreign key

20 Relational Data Analysis Summary: Choose a suitable key from a table of raw dataChoose a suitable key from a table of raw data Identify repeating groupsIdentify repeating groups Write the data in unnormalised formWrite the data in unnormalised form Convert unnormalised data to first normal formConvert unnormalised data to first normal form Convert first normal form to second normal formConvert first normal form to second normal form Convert second normal form to third normal formConvert second normal form to third normal form

21 Normalisation Constructing a Data Model from 3NF

22 UNFUNF1NF2NF3NF LEVEL Course Code1 Course Code Course CodeCourse Code Course Title1 Course Title Course TitleCourse Title Student Code 2 Student Name2Course CodeCourse CodeCourse Code Date of Birth2 Student CodeStudent CodeStudent Code Tutor Code2Student NameTutor Code*Tutor Code Tutor Name2 Date of BirthTutor Name*Grade Grade2 Tutor CodeGrade Result2Tutor NameResultStudent Code GradeStudent Name ResultStudent CodeDate of Birth Student Name Date of BirthTutor Code Tutor Name Grade Result Normalisation Table - 3NF Foreign key

23 Student Results Relations

24 Create an entity type for each data relation e.g. COURSE Course Code COURSE-STUDENT Course Code Student Code *Tutor Code *Grade

25 Make compound key relations into details refers to master / detail relationship COURSESTUDENT COURSE- STUDENT Course Code Student Code Course CodeStudent Code

26 Make relations with foreign keys into details COURSESTUDENT COURSE- STUDENT Course Code Student Code *Tutor Code *Grade Course CodeStudent Code TUTORGRADE Tutor CodeGrade

27 Redrawn Entity Model COURSESTUDENT COURSE- STUDENT Course Code Student Code *Tutor Code *Grade Course CodeStudent Code TUTOR GRADE Tutor Code Grade

28 Example 2

29 Rule 1 Create an entity type for each data relation e.g. COURSE Course Code COURSE-STUDENT Course Code Student Code

30 Rule 2 Mark the qualifying elements of hierarchic keys as a foreign key hierarchic key in this example ASSIGNMENT *(Course Code) (Ass. Number) Rule 2

31 Rule 3 Check that all masters of compound key relations are present This example has two compound keys one made from simple key and hierarchic key one made from two simple keys COURSE-STUDENT Course Code Student Code RESULT Student Code (Course Code) (Ass. Number)

32 Rule 4 Make compound key relations into details refers to master / detail relationship COURSESTUDENT COURSE- STUDENT Course Code Student Code Course CodeStudent Code

33 Rule 4 Make compound key relations into details refers to master / detail relationship COURSESTUDENT COURSE- STUDENT Course Code Student Code Course CodeStudent Code ASSIGNMENT RESULT *(Course Code) (Ass. Number) Student Code (Course Code) (Ass. Number) Rule 4

34 Rule 5 COURSE STUDENT COURSE- STUDEN T Course Code Student Code Course Code Student Code ASSIGNMENT RESULT *(Course Code) (Ass. Number) Student Code (Course Code) (Ass. Number) Make relations with foreign keys into details Rule 5 Rule 2

35 3NF Model COURSE STUDENT COURSE- STUDENT Course Code Student Code Course Code Student Code ASSIGNMENT RESULT *(Course Code) (Ass. Number) Student Code (Course Code) (Ass. Number) Rule 4 Rule 5 Rule 2