Supplement 11 : Why Normalisation or ER Modelling 1 11 Supplement – Why Normalisation or ER Modelling And Franchise Colleges By MANSHA NAWAZ.

Slides:



Advertisements
Similar presentations
The Relational Model and Normalization (1)
Advertisements

Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Copyright: ©2005 by Elsevier Inc. All rights reserved. 1 Author: Graeme C. Simsion and Graham C. Witt Chapter 3 The Entity-Relationship Approach.
Author: Graeme C. Simsion and Graham C. Witt Chapter 11 Logical Database Design.
Relational Database and Data Modeling
Introduction to SQL 1 Lecture 5. Introduction to SQL 2 Note in different implementations the syntax might slightly differ different features might be.
Information Systems Today: Managing in the Digital World
Chapter 5 Normalization of Database Tables
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Copyright © 2008 Pearson Prentice Hall. All rights reserved.1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2.1: Relational Databases.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 1Creating Tables and Queries Chapter 2Creating Relationships between Tables.
Access Tables 1. Creating a Table Design View Define each field and its properties Data Sheet View Essentially spreadsheet Enter fields You must go to.
Developing ER-Diagram
Functional Dependencies and Normalization for Relational Databases
Chapter 15 A Table with a View: Database Queries.
Section 09ER Decomposition Of Many To Many1 HSQ - DATABASES & SQL And Franchise Colleges 09 ER Decomposition of Many-to-Many.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Relational Databases Chapter 4.
Section 11 : Normalisation - A Worked Example
Monash University Week 7 Data Modelling Relational Database Theory IMS1907 Database Systems.
Database table design Single table vs. multiple tables Sen Zhang.
Database Management System (DBMS)
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
The Relational Database Model:
SLIDE 1IS 257 – Fall 2004 Database Design: Normalization and The Relational Model University of California, Berkeley School of Information.
Database – Part 2a Dr. V.T. Raja Oregon State University.
Relational Databases What is a relational database? What would we use one for? What do they look like? How can we describe them? How can you create one?
Introduction to Schema Refinement. Different problems may arise when converting a relation into standard form They are Data redundancy Update Anomalies.
N. J. Taylor Database Management Systems (DBMS) 1.
Normalization Rules for Database Tables Northern Arizona University College of Business Administration.
Normalization. Introduction Badly structured tables, that contains redundant data, may suffer from Update anomalies : Insertions Deletions Modification.
Week 6 Lecture Normalization
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)
Section 11 : Normalisation
Data Modelling – ERD Entity Relationship Diagram’s Entity Relationship Diagrams and how to create them. 1.
Concepts and Terminology Introduction to Database.
Supplement 01 (b)Database Introduction-2 HSQ - DATABASES & SQL And Franchise Colleges By MANSHA NAWAZ Supplement 01(b) Database-Introduction-2.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
CORE 2: Information systems and Databases NORMALISING DATABASES.
RDBMSSection Relational DBMS DATABASE DEVELOPMENT And Franchise Colleges By MANSHA NAWAZ.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
Organizing Data and Information. What is Data?? Numbers, characters, images, or other method of recording, in a form which can be assessed by a human.
1 IRU – database design part one Geoff Leese September 2009.
Database Fundamentals Lecture 4 Useful website for MySQL download language.com/workshops/Default.asp ?workshop=21.
COMP1212 COMP1212 Anomalies and Dependencies Dr. Mabruk Ali.
Unit 5 Advanced Databases The Purpose and features of a relational database.
Flat Files Relational Databases
3 1 Database Systems The Relational Database Model.
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
Databases Flat Files & Relational Databases. Learning Objectives Describe flat files and databases. Explain the advantages that using a relational database.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
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.
Lecture on Database Management System
Microsoft Access CS 110 Fall Entity Relationship Model Entities Entities Principal data object about which information is to be collectedPrincipal.
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.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
NORMALISATION OF DATABASES. WHAT IS NORMALISATION? Normalisation is used because Databases need to avoid have redundant data, which makes it inefficient.
Database Management Systems (DBMS)
Normalization Referential Integrity
Database solutions Chosen aspects of the relational model Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology.
Flat Files & Relational Databases
Spreadsheets, Modelling & Databases
Presentation transcript:

Supplement 11 : Why Normalisation or ER Modelling 1 11 Supplement – Why Normalisation or ER Modelling And Franchise Colleges By MANSHA NAWAZ

Supplement 11 : Why Normalisation or ER Modelling 2 Why Normalisation or ER Modelling ? n ‘Boyce Codd’ identified 3 main problems to which data was problematic when maintaining or updating data. DELETIONINSERTION AMENDMENT Information is maintained about students, modules and lecturers in a university based on 3rd generation language (3GL) environment such as Pascal, Basic, Cobol, etc, or on a spreadsheet as follows. Module NameStaff#StaffNameStudent#StudentNameAssGradeAssType Systems Design234Nawaz M12345Smith SPcwk1 Systems Design234Nawaz M12345Smith SMcwk2 Systems Design234Nawaz M12346Jones SPcwk1 Systems Design234Nawaz M12347Patel PMcwk1 Systems Design234Nawaz M12347Patel PFcwk2 Systems Analysis234Nawaz M12345Smith SDcwk1 Systems Analysis234Nawaz M12345Smith SDcwk2 Databases345Capper G12300Smith JPcwk1

Supplement 11 : Why Normalisation or ER Modelling 3 u u DELETION What if we wish to delete student (BOLD) Lose information on Databases (ITALICS) This is the DELETION ANOMILY or deletion side-effect Deletion of old information without deletion of other related data. Information is maintained about students, modules and lecturers in a university on a spreadsheet as follows. Module NameStaff#StaffNameStudent#StudentNameAssGradeAssType Systems Design234Nawaz M12345Smith SPcwk1 Systems Design234Nawaz M12345Smith SMcwk2 Systems Design234Nawaz M12346Jones SPcwk1 Systems Design234Nawaz M12347Patel PMcwk1 Systems Design234Nawaz M12347Patel PFcwk2 Systems Analysis234Nawaz M12345Smith SDcwk1 Systems Analysis234Nawaz M12345Smith SDcwk2 Databases345Capper G12300Smith JPcwk1

Supplement 11 : Why Normalisation or ER Modelling 4 u INSERTION What if we admit a new student on to a module We cannot enter a student record until a student has had at least one assessment. This is the INSERTION ANOMILY or an insertion side-effect Insertion of new information without the existence of other related data. Module NameStaff#StaffNameStudent#StudentNameAssGradeAssType Systems Design234Nawaz M12345Smith SPcwk1 Systems Design234Nawaz M12345Smith SMcwk2 Systems Design234Nawaz M12346Jones SPcwk1 Systems Design234Nawaz M12347Patel PMcwk1 Systems Design234Nawaz M12347Patel PFcwk2 Systems Analysis234Nawaz M12345Smith SDcwk1 Systems Analysis234Nawaz M12345Smith SDcwk2 Databases345Capper G12300Smith JPcwk1 ? ? ? Green A ? ?

Supplement 11 : Why Normalisation or ER Modelling 5 u AMENDMENT What if we change the lecturer of Databases to Jones We would need to update both staffname & staff# This is the AMENDMENT ANOMILY or an update side-effect Anomalies and inefficiencies arising from numerous data items. Inconsistency amongst stored values of that data item. Amendment effort required when a value changes. Module NameStaff#StaffNameStudent#StudentNameAssGradeAssType Systems Design234Nawaz M12345Smith SPcwk1 Systems Design234Nawaz M12345Smith SMcwk2 Systems Design234Nawaz M12346Jones SPcwk1 Systems Design234Nawaz M12347Patel PMcwk1 Systems Design234Nawaz M12347Patel PFcwk2 Systems Analysis234Nawaz M12345Smith SDcwk1 Systems Analysis234Nawaz M12345Smith SDcwk2 Databases345Capper G12300Smith JPcwk1

Supplement 11 : Why Normalisation or ER Modelling 6 3GL FLAT FILE : all data recorded in one file. Example : A list of projects undertaken by companies in the region. P# PtitlePdescE# EnameEaddress p1 AccountsExcele4 MBCMiddlesbrough p1 ACCOUNTSEXCELe4 Middlesbrough CouncilM’Boro p1 AccountsExcele8 Teesside UniversityEston p2 Stock ControlDatabasee8 University of TeessideBorough Rd p3 ReservationRoomse8 University of TeessideBorough Rd p3 ReservationRoomse1 ICIWilton Rd p3 ReservationRoomse2 British SteelSouth Bank p4 SalesCobole2 British SteelSouth Bank Discuss the problems with the above data set in terms of : *DUPLICATION & REDUNDANCY *PHYSICAL SIZE & SPEED *INFORMATION RETRIVAL FURTHER CONSIDERATIONS :

Supplement 11 : Why Normalisation or ER Modelling 7 P# Ptitle Pdesc p1 Accounts Excel p2 Stock Control Database p3 Reservation Rooms p4 Sales Cobol SOLUTION : USE 4GL TOOLS & TECHNIQUES Example : A list of projects undertaken by companies in the region. PROJECTS(P#, Ptitle, Pdesc) PROJ_EMP(P#, E#) EMPLOYER(E#, Ename, Eaddress) PROJECTSPROJ_EMPEMPLOYER The above has no DUPLICATED, REDUNDENT or NULL data. E# Ename Eaddress e1 ICI Wilton Rd e2 British Steel South Bank e4 MBC Middlesbrough e8 University of Teesside Borough Rd P# E# p1 e4 p1 e8 p2 e8 p3 e8 p3 e1 p3 e2 p4 e2 n Normalisation or ER Modelling are tools used to derive such solutions. used to derive such solutions.

Supplement 11 : Why Normalisation or ER Modelling 8 Data Modelling Definitions. n ENTITY u Object being modelled. u Independent existence. u One Row Per Entity Occurrence. u Look for object name or thing. F eg INVOICE, ORDER, STUDENT, LECTURER u Look for things requiring a list of associated records or tabular list of data. u Each existence of an entity value requires a record. u Look for things with record keys. u eg stock code -> STOCK reg. no. -> CAR

Supplement 11 : Why Normalisation or ER Modelling 9 n TABLE u A class of entities (or objects) in the system F example : ‘stock’ ‘customer’ ‘employee’ n TABLE OCCURRENCE u tabular list of data associated with the entity F occurrence of table STOCK STOCK

Supplement 11 : Why Normalisation or ER Modelling 10 n TABLE TYPE u file structure u STOCK(part#, part-desc, qty) n ROW u occurrence of an entity n ATTRIBUTE u item of data u associated with each entity or object u example : An entity STOCK has F part#, part-desc & qty attributes

Supplement 11 : Why Normalisation or ER Modelling 11 n ATTRIBUTE VALUE u a particular occurrence’s characteristics F part-desc of attribute value ‘p3’ is ‘washer’ n KEYS u often one attribute of the entity will characterise or identify the individual occurrences F part# in STOCK u such an attribute is called a key attribute is underlined or identified by symbol n COMPOUND KEYS u in some entities no such key value is present u may be able to find 2 or more attributes to fulfil task u pairings of such attributes is called compound key

Supplement 11 : Why Normalisation or ER Modelling 12 n FOREIGN KEYS u as keys but will be appear in other tables and is used to assist in linkage across tables F part# in ORDERS will identify the parts for an order F part# in PARTS will identify the part F order# in ORDERS will identify the order u only foreign keys should be duplicated in other tables. n RELATIONSHIP u Is an association or linkage between two or more entities via a common key value. u Common key values can F either be held in the adjoining TABLES F or can be held in a RELATIONSHIP TABLE

Supplement 11 : Why Normalisation or ER Modelling 13 P# Ptitle Pdesc p1 Accounts Excel p2 Stock Control Database p3 Reservation Rooms p4 Sales Cobol PROJECTS PROJ_EMP EMPLOYER E# Ename Eaddress e1 ICI Wilton Rd e2 British Steel South Bank e4 MBC Middlesbrough e8 University of Teesside Borough Rd P# E# p1 e4 p1 e8 p2 e8 p3 e8 p3 e1 p3 e2 p4 e2 PROJECT and EMPLOYER are linked via the relationship PROJ_EMP u Relationship is used to share attributes (data) between entities u Allows the linkage necessary to build a DATA MODEL u DATA MODEL for PROJECTS

Supplement 11 : Why Normalisation or ER Modelling 14 The 4 Rules for Normalised Tables No row order significance. No column order significance. No multiple values at row/column intersections. No duplicate rows. Snapshots of table occurrences. –When we look at a paper copy of a table remember that the data in a real database table can be expected to change all the time. –The COPIES table could have 5 rows the first time we look and on another day there could be hundreds or thousands. –Always assume a database table really has thousands of rows.

Supplement 11 : Why Normalisation or ER Modelling 15 The 4 rules for Normalised Tables broken No row order significance (Rule broken). If you swap the rows you lose information as copies are sometimes dependent on the row above for their ISBNX number.

Supplement 11 : Why Normalisation or ER Modelling 16 No Column Order Significance (Rule broken). The two columns with no attribute type shown are intended to indicate the date-purchased followed by the date-removed. –The date-removed column would contain a significant number of NULLS (explained later). The two columns are now dependent on the column order for their meaning. –If you move the first date column to the end of the table then the meaning is lost. Clearly having each column with its own attribute type is simpler and makes the columns order independent of each other.

Supplement 11 : Why Normalisation or ER Modelling 17 No Multiple Values at Row/column Intersections (Rule Broken). Or No Repeating Groups This is just too complicated – it makes searching and sorting difficult. Can you sort this into date order?? Can it be easily searched on access_no ??

Supplement 11 : Why Normalisation or ER Modelling 18 No Duplicate Rows (Rule broken). Why is this such a BAD idea? If you allow redundantly duplicated data in a real system, what will be the end result?