Normalisation up to 1NF Bottom-up Approach to Data Modelling.

Slides:



Advertisements
Similar presentations
Relational Database Systems Higher Information Systems.
Advertisements

Normalisation.
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.
3/5/2009Computer systems1 Analyzing System Using Data Dictionaries Computer System: 1. Data Dictionary 2. Data Dictionary Categories 3. Creating Data Dictionary.
Relational Database Systems Higher Information Systems.
Normalisation Ensuring data integrity in database design 1.
Building a database. Implementation of desirable features Integrity –A field’s validation can be declared when the field is declared. If this validation.
Normalisation “A formal technique for analysing relations based on their primary key and functional dependencies.” [Codd]. Process – Analyse each relation.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
CS263:Revision on Normalisation
Defining Data Flows Data Dictionary. 1 DFDs use simple labels describing content of data store or data flow –do not include detail data descriptions Detail.
Tutorial 2 DT228/3 Database Technology. Joe’s Yard Take the following documents: –The script as prepared –The docket –The diary in the yard –The list.
1 NORMALISATION. 2 Introduction Overview Objectives Intro. to Subject Why we normalise 1, 2 & 3 NF Normalisation Process Example Summary.
Further Data Modelling …and the effect of time. Plan Introduction Structured Methods –Data Flow Modelling –Data Modelling –Relational Data Analysis –Further.
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
System Analysis and Design
Week 2 Lecture 2 Structure of a database. External Schema Conceptual Schema Internal Schema Physical Schema.
LOGICAL DATABASE DESIGN
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
File and Database Design SYS364. Today’s Agenda WHTSA DBMS, RDBMS, SQL A place for everything and everything in its place. Entity Relationship Diagrams.
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)
Section 11 : Normalisation
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Concepts and Terminology Introduction to Database.
Richard Merritt1 Data Modelling Entities, Attributes and Relationships.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
Normalisation Mia’s Sandwich Shop The Process Explained.
Bottom Up Analysis Bottom-up Data Analysis An Example.
SALINI SUDESH. Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that avoid unnecessary duplication of.
CORE 2: Information systems and Databases NORMALISING DATABASES.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
1 Information Retrieval and Use Data Analysis & Data Modeling, Relational Data Analysis and Logical Data Modeling Geoff Leese September 2009.
Conceptual Database Design
Information Systems & Databases 2.2) Organisation methods.
Normalisation Africamuseum 5 June What is ‘Normalisation’?  Theoretical: satisfying the requirements of the different ‘Normal Forms’, as spelled.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
CIS 210 Systems Analysis and Development Week 6 Part II Designing Databases,
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.
M1G Introduction to Database Development 4. Improving the database design.
+ Information Systems and Databases 2.2 Organisation.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
©NIIT Normalizing and Denormalizing Data Lesson 2B / Slide 1 of 18 Objectives In this section, you will learn to: Describe the Top-down and Bottom-up approach.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
IT The Relational DBMS Section 05. Relational Database Theory Normalization for Logical Database Design.
Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.
Chapter 56 Relational Database Design Compiled by Eddie Moorcroft.
Lection №4 Development of the Relational Databases.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Mr C Johnston ICT Teacher
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Topic 3 – Data Modeling Techniques Unit 1 – Database Analysis and Design Advanced Higher Information Systems St Kentigern’s Academy.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Entity Relationship Diagram (ERD). Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
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?
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.
Dr Gordon Russell, Napier University Normalisation 1 - V2.0 1 Normalisation 1 Unit 3.1.
Databases – Exam questions
Chapter 4.1 V3.0 Napier University Dr Gordon Russell
BTEC ICT – Unit 18 With Mr Griffiths.
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Presentation transcript:

Normalisation up to 1NF Bottom-up Approach to Data Modelling

Objectives Define the purpose of normalisation Determinacy / Dependency First Normal Form Second Normal Form Third Normal Form

10 Normalisation Normalisation provides algorithms for reducing complex data structures into simple data structures Concerned with –tidying up the data so there is no data redundancy –ensuring that data is grouped logically Bottom up approach - start with data items Codd’s Law is a set of rules which ensure that the data is grouped correctly –A normal form is a convenient structure into which data can be organised

A relation is relational… If and only if every non-key attribute is determined by the KEY… the WHOLE KEY…. and nothing but the KEY so help me CODD! Dr. E.F. Codd, an IBM researcher, first developed the relational data model in 1970

Concept of Determinacy and Dependency if A determines B - then B is dependent on A B is dependent on A if given a value for A, there is only one possible value for B –e.g. –student name is dependent on student number and –student number determines student name

12 First Normal Form (1NF) –an form is in 1NF if and only if it has an identifying key and there are no repeating groups of attributes To do 1.Find the key to the original form 2.remove calculated (derived) fields from the original form 3.move repeating attributes into a new form –These are generally column headings in a grid. 4.Add the key to the original form as a foreign key to the new form 5.Determine the key to the new form Result: 1NF forms

Second Normal Form (2NF) a form is in 2NF if and only if it is in 1NF and has no attributes which require only part of the key to uniquely identify them To do - remove part-key dependencies: 1.where a key has more than one attribute, check that each non-key attribute depends on the whole key and not part of the key 2.for each subset of the key which determines an attribute or group of attributes create a new form. Move the dependant attributes to the new form. 3.Add the part key to new form, making it the primary key. 4.Mark the part key as a foreign key in the original form. Result: 2NF forms

Third Normal Form (3NF) –an form is in 3NF if and only if it is in 2NF and no non-key attribute depends on any other non key attribute To do - remove non key dependencies: 1.decide on the direction of the dependency 2.if A depends on B create new form. Copy B to it as the primary key and move A as attribute(s) 3.leave B in original form, mark it as a foreign key. A and B can be groups of attributes Result: 3NF forms

Representing Normal Forms Graphically If primary key of form A is a subset of the primary key of form B, then the relationship of A to B is one to many If P contains foreign key F and F is the primary key of Q, then the relationship of P to Q is many to one Use form and relationship notation as before

Two Technique Approach to Data Modelling E-R diagramming to find and group all data items normalisation to ensure data items are grouped correctly

Joe’s Docket

Before we begin… We have already discussed –Entities –Attributes –Values –Data and Metadata We now take one of the documents and apply: –Unnormalised form rules (Data Dictionary format) –First Normal Form rules –Second Normal Form rules –Third Normal Form rules

Data Dictionary –central store of data that supports other models –unambiguous and concise way of recording data about data (metadata) –can be recorded manually or using a software tool –encourages consistency between models by using same names in different models –prevents duplication of data –resolves problems of aliases which are all recorded against the appropriate data item –built up as the models are developed –aids communication as everyone on development team knows the exact meaning of words and terms used

Sequence, selection, iteration Sequence : + –CustomerDetails = Name + Address + PhoneNo Repetition : { } –Name = Title + {Initial} + Surname Optionality : ( ) –CustomerDetails = Name + Address +(PhoneNo) Selection : […|…] – Name = (Title) + [ {ForeName} | {Initial} ] + Surname Values : “…” –Title = [ “Dr” | “Mr” | “Mrs” | “Ms” ] Comments : *….*

4 Example Full data dictionary entries for CustomerDetails Address = {AddressLine} CustomerDetails = Name + Address + (PhoneNo) Name = (Title) + [ {ForeName} | {Initial} ] + Surname Title = [ “Dr” | “Mr” | “Mrs” | “Ms” ]

Our Docket again…

Making the Docket logical Many of the names on the docket are local to Joe’s business. We try to make them more standard, so –A Docket becomes a Customer Order or COrder. There are three signatures on the Docket. Signatures by their nature are manual. In a computerised system, these will be replaced by an authorisation procedure, which will show –which staff member – their number will do - took payment (StaffPaid) and –which staff member marked the items as received (StaffIssued). –The customer name is also kept on record.

Data Dictionary Definition of the Docket Unnormalised data –COrder = COrderNo + {Stock_Code + QuantityRequired +(StockDescription) + UnitPrice + 20%VAT + TotalPrice} + TotalAmtDue + StaffPaid +StaffIssued + StaffName + StaffRole + customer_name

12 Remember (1NF) To do 1.Find the key to the original form 2.remove calculated (derived) fields from the original form 3.move repeating attributes into a new form 4.Add the key to the original form as a foreign key to the new form 5.Determine the key to the new form Result: Forms in First Normal Form

Normalising… Find the key to the original form: –The COrderNo uniquely defines the COrder Remove calculated (derived) fields: –TotalPrice, 20%VAT and TotalAmtDue are derived fields. Each can be calculated from other data on the form. –COrder = COrderNo + {Stock_Code + QuantityRequired +(StockDescription) + UnitPrice} + StaffPaid +StaffIssued + StaffName + StaffRole + Customer_Name

…Normalising… move repeating attributes into a new form –Original form COrder = COrderNo + StaffPaid + StaffIssued + StaffName + StaffRole + Customer_Name –New form COrderLine = Stock_Code + QuantityRequired +(StockDescription) + UnitPrice –Add the key to the original form as a foreign key to the new form –New form COrderLine = Stock_Code + QuantityRequired +(StockDescription) + UnitPrice + COrderNo* –Determine the key to the new form COrderLine = Stock_Code+COrderNo* + StockDescription + UnitPrice + QuantityRequired