Data normalization. Integrity and Robustness.

Slides:



Advertisements
Similar presentations
Picking out ERD Entities 14 th March Steps in Constructing ERDs 1.Read and re-read the narrative 2.Make assumptions 3.Identify the entities 4.Define.
Advertisements

e-DMAS Consumer Web Order Entry (WEBOE8) An Enhancement For iSeries 400 DMAS from  Copyright I/O International, 2003, 2004, 2005 Skip Intro.
Lesson-20 Data Modeling and Analysis(2)
The Relational Database Model:
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Modern Systems Analysis and Design Third Edition
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
LOGICAL DATABASE DESIGN
Lecture Note 8 Using Data Flow Diagrams
Creating databases for web applications
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Relational Database Concepts. Let’s start with a simple example of a database application Assume that you want to keep track of your clients’ names, addresses,
Creating databases for web applications SQL. Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Lecture 12 Designing Databases 12.1 COSC4406: Software Engineering.
Introduction to Databases Trisha Cummings. What is a database? A database is a tool for collecting and organizing information. Databases can store information.
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Customer Order Order Number Date Cust ID Last Name First Name State Amount Tax Rate Product 1 ID Product 1 Description Product 1 Quantity Product 2 ID.
Creating Databases for web applications [Complete presentations] More SQL Class time: discuss final projects. Do posting if you have not done it.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Create Databases for Web Applications Database normalization. Classwork/Homework: determine teams for basic projects explain and enhance assignment.
Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working.
Final Exam Review Geb Thomas. Information Systems Applications.
Online Catalog Tutorial. Introduction Welcome to the Online Catalog Tutorial. This is the place to find answers to all of your online shopping questions.
Creating Databases One-way encryption. Passwords. Security issues. Data normalization. Integrity and Robustness. Homework: Finalize teams & projects. Making.
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.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Database Planning Database Design Normalization.
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 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Database Development Lifecycle
Introduction To DBMS.
Chapter 5 UNDERSTANDING AND DESIGNING ACCOUNTING DATA
IT Business Applications
Using Use Case Diagrams
Systems Analysis and Design
Attributes and Domains
MIS2502: Data Analytics Relational Data Modeling
Information Systems Today: Managing in the Digital World
DESIGNING DATABASE APPLICATIONS
and Defining Table Relationships
Chapter 5: Logical Database Design and the Relational Model
Creating databases for web applications
MIS 322 – Enterprise Business Process Analysis
Introduction to Database Systems
Modern Systems Analysis and Design Third Edition
ER MODEL Lecture 3.
e-Stores have many titles:
Retail Sales is used to illustrate a first dimensional model
Final Exam Review Geb Thomas.
Chapter 9 Designing Databases
© 2011 Pearson Education, Inc. Publishing as Prentice Hall
Basic Concepts in Data Management
Sales Order Process.
Chapter 9 Designing Databases
Chapter 12 Designing Databases
MIS2502: Data Analytics Relational Data Modeling
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Relational Database Model
MIS2502: Data Analytics Relational Data Modeling
Retail Sales is used to illustrate a first dimensional model
Using Use Case Diagrams
Retail Sales is used to illustrate a first dimensional model
MIS2502: Data Analytics Relational Data Modeling
Chapter 17 Designing Databases
Information Systems Development MIS331
Information Systems in Organizations 2. 1
Normalisation 1 Unit 3.1 Dr Gordon Russell, Napier University
Presentation transcript:

Data normalization. Integrity and Robustness. Creating Databases Data normalization. Integrity and Robustness. Work session. Homework: Prepare short presentation on enhancement projects. Continue working on implementation.

What is normalization? Data analysis is a process that prepares a data model for implementation as a simple, non-redundant, flexible, and adaptable database. The specific technique is called normalization. Normalization is a data analysis technique that organizes data attributes such that they are grouped to form non-redundant, stable, flexible, and adaptive entities. ASSUMES that you have reports, input forms that capture all the information. This and following charts are from information systems analysis course. Don't be overcome by the language. This is to show you the process, that there is a process—it isn't guess work.

Goals of normalization Have well-defined tables—at most one value for each field. Store each item of information exactly one place so if/when it changes, only have to change one place. Relationships are valid: foreign keys refer to existing primary keys. Don't store items that can be calculated so making changes is simplified.

Process of defining database Generally starts with the desired end products (sometimes called artifacts) Reports Forms May be from original, possibly even non-automated version of application May be from combination of applications. Goal is to produce single database that serves multiple uses.

But… Problems are common. Example: change address [one place] but old information persists. Your experience?

Normalization process First step is to do what is necessary to get each entity into 1st normal form: An entity is in first normal form (1NF) if there are no attributes that can have more than one value for a single instance of the entity. Any attributes that can have multiple values actually describe a separate entity, possibly an entity and relationship. Common situation is so-called multiple values, such as distinct items in an order (distinct beneficiaries, game-machines) Action is to create new entity In the typical product order case, there can be multiple items ordered in each 'order. So these are extracted.

Modifying model to 1st NF The primary key for the new table is a so-called concatenated key. Here it is the promotion and the title. So notice that the primary key for the title promotion records consist of two foreign keys=keys pointing to other tables. Many items (titles) Associative entity: Use combination of keys for new (concatenated) key

Moving to 2nd NF If you do not have any concatenated keys, no work is needed. Model is already in 2nd NF. If you do have any concatenated (combination) keys, you need to examine these entities. An entity is in second normal form (2NF) if it is already in 1NF and if the values of all nonprimary key attributes are dependent on the full primary key—not just part of it. Any nonkey attributes that are dependent on only part of the primary key should be moved to any entity where that partial key is actually the full key. This may require creating a new entity and relationship on the model. The process of getting something in 1NF may have carried over data that appears somewhere else. You don't want data twice. (You may choose to make whole databases redundant, for efficiency of access or for backup, but that is done separately.)

Moving to 2nd NF Some attributes relate to the product itself, not the fact that the product is part of this order. Remove these attributes. To say the same thing a slightly different way: you don't need this product only data in the ordered product record.

So… In my store example, the ordered items records would NOT have information just relating to the order or just relating to the product.

Moving to 3rd NF Make sure that all non-primary attributes depend just on the key, not, for example, on another attribute. An entity is in third normal form (3NF) if it is already in 2NF and if the values of its nonprimary key attributes are not dependent on any other non-primary key attributes. Any nonkey attributes that are dependent on other nonkey attributes must be moved or deleted. Again, new entities and relationships may have to be added to the data model. Typical example is something that can be calculated.

Example of move to 3rd NF First of two examples

Example of move to 3rd NF Second of two examples.

The whole ER diagram this particular example. MEMBER Primary Key Member-Number [PK1] Non-Key Attributes Member-Name Member-Status Member-Street-Address Member-Post-Office-Box Member-City Member-State Member-Zip-Code Member-Daytime-Phone-Number Member-Date-of-Last-Order Member-Balance-Due Member-Credit-Card-Type Member-Credit-Card-Number Member-Credit-Card-Expire-Date Member-Bonus-Balance-Available Audio-Category-Preference Audio-Media-Preference Date-Enrolled Expiration-Date Game-Category-Preference Game-Media-Preference Number-of-Credits-Earned Video-Category-Preference Video-Media-Preference Agreement-Number [FK] Privacy-Code Email-Address MEMBER ORDER Order-Number [PK1] Order-Creation-Date Order-Fill-Date Shipping-Address-Name Shipping-Street-Address Shipping-City Shipping-State Shipping-Zip Shipping-Instructions Order-Sub-Total Order-Sales-Tax Order-Shipping-Method Order-Shipping-&-Handling-Cost Order-Status Order-Prepaid-Amount Order-Prepayment-Method Promotion-Number [FK] Member-Number [FK] Member-Number-1 . Member-Number [FK] PRODUCT Product-Number [PK1] "Universal-Product-Code (Alternate Key)" Quantity-in-Stock Product-Type Suggested-Retail-Price Default-Unit-Price Current-Special-Unit-Price Current-Month-Units-Sold Current-Year-Units-Sold Total-Lifetime-Units-Sold VIDEO TITLE Product-Number [PK1] [FK] Producer Director Video-Category Video-Sub-Category Closed-Captioned Language Running-Time Video-Media-Type Video-Encoding Screen-Aspect MPA-Rating-Code AUDIO TITLE Artist Audio-Category Audio-Sub-Category Number-of-Units-in-Package Audio-Media-Code Content-Advisory-Code GAME TITLE Manufacturer Game-Category Game-Sub-Category Game-Platform Game-Media-Type Number-of-Players Parent-Advisory-Code TRANSACTION Transaction-Reference-Number [PK1] Transaction-Date Transaction-Type Transaction-Description Transaction-Amount Order-Number [FK] TITLE Title-of-Work Title-Cover Catalog-Description Copyright-Date Entertainment-Category Credit-Value MEMBER ORDERED PRODUCT Order-Number [PK1] [FK] Product-Number [PK2] [FK] Quantity-Ordered Quantity-Shipped Quantity-Backordered Purchase-Unit-Price Credits-Earned MERCHANDISE Merchandise-Name Merchandise-Description Merchandise-Type Unit-of-Measure AGREEMENT Agreement-Number [PK1] Agreement-Expire-Date Agreement-Active-Date Fulfillment-Period Required-Number-of-Credits PROMOTION Promotion-Number [PK1] Promotion-Release-Date Promotion-Status Promotion-Type 3NF Member Services (Entity Relation Subject Area) SA/2001 Tue May 02, 2000 10:41 Comment Sandra Shepherd TITLE PROMOTION Promotion-Number [PK2] [FK] places binds features is featured as is a has conducted responds to generates sold as sells The whole ER diagram this particular example.

Normalization …. is a process. It is [somewhat] mechanical. There is chance that your model may be in 1st, 2nd, or even 3rd without action or much action on your part, but it can be good to go through the process. Note: Some may argue for certain redundancies, for example, storing a calculated value. Why or why not? Answers to question?

About assignment You can specify conditions that simplify your application For a course catalog application, allow 0 or 1 pre-req, not unlimited number. Upload files using Filezilla. I will demonstrate file upload code and related issues. ? Do some checking of user input. I will expect more for your final project.

Classwork/Homework Prepare short presentation on enhancement project, including Entity-Relationship diagrams (which may not have changed from mine) and Data Flow Diagram (which probably did change) Work on enhancement projects.