1 Transforming the Data Model into Relations (Tables) and Normalisation Students.

Slides:



Advertisements
Similar presentations
Normalisation.
Advertisements

© 2005 by Prentice Hall Chapter 3a Database Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
Introduction to Databases
Copyright © 2016 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
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)
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
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!
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Avoiding Database Anomalies
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Concepts of Database Management, Fifth Edition
A Normalisation Example Mark Kelly McKinnon Secondary College Vceit.com Based on work by Robert Timmer-Arends.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
Normalisation Rules and Practical Application Geoff Leese January 2010.
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.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
10/3/2012ISC329 Isabelle Bichindaritz1 Logical Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
MS Access: Creating Relational Databases Instructor: Vicki Weidler Assistant: Joaquin Obieta.
Normalization Information Systems II Ioan Despi. Informal approach Building a database structure : A process of examining the data which is useful & necessary.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Unit 4 Object Relational Modeling. Key Concepts Object-Relational Modeling outcomes and process Relational data model Normalization Anomalies Functional.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Database Design – Lecture 8
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.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Database Design Normalisation. Last Session Looked at: –What databases were –Where they are used –How they are used.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
April 20022CS3X1 Database Design Normalisation (1) John Wordsworth Department of Computer Science The University of Reading Room.
Normalisation 1NF to 3NF Ashima Wadhwa. In This Lecture Normalisation to 3NF Data redundancy Functional dependencies Normal forms First, Second, and Third.
Chapter 8: Object-Relational Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A. Hoffer.
Databases Database Normalisation. Learning Objectives Design simple relational databases to the third normal form (3NF).
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
Lecture 4: Logical Database Design and the Relational Model 1.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
FEN Introduction to the database field: The development process Seminar: Introduction to relational databases Development process: Analyse.
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.
Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.
Database Normalization. What is Normalization Normalization allows us to organize data so that it: Normalization allows us to organize data so that it:
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
Logical Design & the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Chapter 4 Relational Databases
Database Normalization
Relational Database.
Teaching slides Chapter 8.
Database Normalisation
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Presentation transcript:

1 Transforming the Data Model into Relations (Tables) and Normalisation Students

2 External Level Specification - Identify all User views zUser View - subset of data required by user. Takes the form of zprinted report-e.g. register zscreen display - e.g.. all student info.. zinput form zroutine query - e.g. how many students on course? zad hoc query - e.g. which courses does F.Bloggs take

3 zDraw an ER diagram of each user view integrate to produce ER diagram of system (each entity with attributes to appear only once) zThis should ensure that all the attributes have been included

4 Transforming the data model into Tables (relations) zeach entity becomes a table with a column for each attribute, the entity identifier is the primary key for the table. z1:N relationship is represented by placing the primary key on one side of the relationship, as a foreign key in the table for the entity in the many side

5 e.g. customer : order (a one to many relationship) cust-no.nameaddresscitydiscount order-no. order-datepromised-datecust-no. CUSTOMER TABLE primary key foreign key one Many ORDER TABLE

6 An M:N (Many to Many) relationship zTo avoid an invalid construct, create a new table to represent the relationship, the primary key for this is a composite key comprising of the primary keys of the entities on either side of the relationship. e.g. ORDER PRODUCT QUANTITY ORDERED REQUESTED ON

7 M:N relationship example (contd) ORDER TABLE Order-No.Order-date..... PRODUCT TABLE Product-No.Description ORDER-LINES Order-No.Product-No.Quantity primary key Composite Primary Key

8 Class and Sub Class zcreate separate tables for the class and each sub class zthe class table contains only attributes that are common to all subclasses plus a sub class definition column zthe sub class table contains the primary key and only attributes common to that sub class zthe primary keys for the class and subclass tables are the same

9 STUDENT Reg-No. NameU/Grad P/Grad address Reg-No.Year of StudyCourse UNDERGRADUATE Reg-No.Program POSTGRADUATE sub class definition Primary Keys Class / Sub class example

10 Students Example used for next section on Normalisation Students Student_ID Student_Name Campus_Address Core_Subject Tutor Tutor_Name Tutor_Room Course Course_ID Course_Title Tutor_Name Registration Student_ID Course_ID Exam_Grade Register on teaches on Taken on by

11 Normalisation zThe process of decomposing complex data structures into simple relations according to a set of dependency rules. zA step-by-step process used to decompose complex data structures into simple entities (Dowling)

12 Normalisation zOrganising data into tables (files) to minimise data repetition e.g. Redundancy -course fee repeated Insertion - A new course cannot be added until a student registers Deletion - if student withdrew from course we would loose BUS fee information Updating - If MBA fee changed we would have to alter records of all MBA students

13 Normalised zNormalising the data gives Now easy to insert or delete students/course also update fees requires only one amendment BUT may take longer to execute queries

14 The First Normal Form (1NF) (refer to handout) n Analyse ‘functional dependencies’ i.e. the relationship between two attributes Student-ID -> Student_Name, Campus_Address, Core_Subject Course-ID -> Course_Title, Tutor_Name, Tutor_Location Student-ID,Course-ID -> Exam_Grade i.e sort out which attributes uniquely depend on other attributes. the independent attribute becomes the key for the 2NF tables. e.g. Student_ID and Course_ID

15

16 zCreate three new relations (tables) from the first normal form (1NF) zOrganise the attributes into tables, the table key value directly or indirectly determines attribute values y e.g. Student, Course_Tutor and Exam_Result zThis results in 2NF relations (or tables) as shown (N.B two of the relations are already in third normal form) Second Normal Form (2NF)

17 2NF (contd) zThe table Course_Tutor is still in 2NF because it is still open to the problems discussed earlier i.e. zinsertion problems ; its difficult to add a new tutor zupdate problems ; Tutor_Location must be changed a number of times zdeletion problems ; if we delete course QM2 from the table (and it is the only row) we may lose the information that instructor Bentley is located in 3A54

18 Course Tutor Course_Tutor Third Normal Form Second Normal Form

19 Third Normal Form (3NF ) zthe removal of transient dependencies results in the third normal form (3NF) zdivide Course_Tutor into two tables as shown zTutor_Name becomes a foreign key zi.e. an attribute which is a non-key in one table (like Course) and a primary key in another table (like Tutor) zthe foreign key is indicated by underlining with a dashed line zThe normalisation process is now complete