Database Processing: Chapter Four: Using Normalization

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Accounting System Design
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day5.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 David M. Kroenke Database Processing Chapter 4 Database Design Using.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 4-1 COS 346 Day6.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 1-1 COS 346 Day 3.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke Database Processing Chapter 3 Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day4.
Database Lecture Notes Normalization 3 – Denormalization
Chapter 3 The Relational Model and Normalization
Database Technical Session By: Prof. Adarsh Patel.
IT420: Database Management and Organization Normalization 31 January 2006 Adina Crăiniceanu
SQL Server 7.0 Maintaining Referential Integrity.
Chapter 4 The Relational Model and Normalization.
Indexes and Views Unit 7.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 4-1 David M. Kroenke’s Chapter Four: Database.
Chapter 13 Views Oracle 10g: SQL. Oracle 10g: SQL2 Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE VIEW command Employ the.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 What Makes Determinant Values Unique? A determinant is unique in.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Four: Database Design Using Normalization 4-1 KROENKE.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 David M. Kroenke’s Chapter Three: The Relational Model and Normalization.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Four: Database Design Using Normalization.
David M. Kroenke and David J. Auer Database Processing: F undamentals, Design, and Implementation Chapter Three: The Relational Model and Normalization.
1 Structured Query Language (SQL) Pertemuan 09 Matakuliah: F0712 / Lab MS Access Tahun: 2007.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Database Constraints ICT 011. Database Constraints Database constraints are restrictions on the contents of the database or on database operations Database.
Database Constraints Ashima Wadhwa. Database Constraints Database constraints are restrictions on the contents of the database or on database operations.
CSIS 115 Database Design and Applications for Business Dr. Meg Fryling “Dr. Meg” Fall #csis115 © 2012 Meg Fryling.
Adapted from DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 Functional Dependencies and Normalization.
Understanding Data Storage
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
Chapter 6 - Database Implementation and Use
© 2016, Mike Murach & Associates, Inc.
Database Management Systems (DBMS)
Database Processing: David M. Kroenke’s Chapter Four:
Lecture # 13 (After 1st Exam)
Database Design Using Normalization
CIS 336 PAPERS Education for Service-- cis336papers.com.
SQL: Constraints and Triggers
The Relational Model and Normalization
Chapter 9 Designing Databases
Accounting System Design
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Database Design Using Normalization
Insert, Update, Delete Manipulating Data.
Chapter 4 The Relational Model Pearson Education © 2009.
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Three:
The Relational Model Transparencies
A Guide to SQL, Eighth Edition
Database Processing: David M. Kroenke’s Chapter Six:
Accounting System Design
Data Management Innovations 2017 High level overview of DB
Chapter 4 The Relational Model Pearson Education © 2009.
COMP 208/214/215/216 – Lecture 7 Documenting Design.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 7 Using SQL in Applications
David M. Kroenke and David J
國立臺北科技大學 課程:資料庫系統 2015 fall Chapter 14 Normalization.
Relational Database Design
Chapter 4 The Relational Model Pearson Education © 2009.
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Six:
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
Presentation transcript:

Database Processing: Chapter Four: Using Normalization Fundamentals, Design, and Implementation Chapter Four: Database Design Using Normalization

Chapter Premise We have received one or more tables of existing data The data is to be stored in a new database QUESTION: Should the data be stored as received, or should it be transformed for storage?

Assessing Table Structure

Counting Rows in a Table To count the number of rows in a table use the SQL built-in function COUNT(*): SELECT COUNT(*) AS NumRows FROM SKU_DATA;

Examining the Columns To determine the number and type of columns in a table, use an SQL SELECT statement To limit the number of rows retreived, use the SQL TOP {NumberOfRows} keyword: SELECT TOP (10) * FROM SKU_DATA;

Checking Validity of Assumed Referential Integrity Constraints Given two tables with an assumed foreign key constraint: SKU_DATA (SKU, SKU_Description, Department, Buyer) BUYER (BuyerName, Department) Where SKU_DATA.Buyer must exist in BUYER.BuyerName

Checking Validity of Assumed Referential Integrity Constraints To find any foreign key values that violate the foreign key constraint: SELECT Buyer FROM SKU_DATA WHERE Buyer NOT IT (SELECT Buyer FROM SKU_DATA, BUYER WHERE SKU_DATA.Buyer = BUYER.BuyerName);

Designing Updateable Databases

Normalization: Advantages and Disadvantages

Non-Normalized Table: EQUIPMENT_REPAIR

Normalized Tables: ITEM and REPAIR

Copying Data to New Tables INSERT INTO ITEM SELECT DISTINCT ItemNumber, Type, AcquisitionCost FROM EQUIPMENT_REPAIR; INSERT INTO REPAIR SELECT ItemNumber, RepairNumber, RepairDate, RepairAmmount FROM EQUIPMENT_REPAIR;

Designing Read-Only Databases

Normalized Tables

Denormalizing the Data INSERT INTO PAYMENT_DATA SELECT STUDENT.SID, Name, CLUB.Club, Cost, AmtPaid FROM STUDENT, PAYMENT, CLUB WHERE STUDENT.SID = PAYMENT.SID AND PAYMENT.Club = CLUB.Club;

Customized Tables Read-only databases are often designed with many copies of the same data, but with each copy customized for a specific application Consider the PRODUCT table:

Customized Tables PRODUCT_PURCHASING (SKU, SKU_Description, VendorNumber, VendorName, VendorContact_1, VendorContact_2, VendorStreet, VendorCity, VendorState, VendorZip) PRODUCT_USAGE (SKU, SKU_Description, QuantitySoldPastYear, QuantitySoldPastQuarter, QuantitySoldPastMonth) PRODUCT_WEB (SKU, DetailPicture, ThumbnailPicture, MarketingShortDescription, MarketingLongDescription, PartColor) PRODUCT_INVENTORY (SKU, PartNumber, SKU_Description, UnitsCode, BinNumber, ProductionKeyCode)

Common Design Problems

The General-Purpose Remarks Column A general-purpose remarks column is a column with a name such as: Remarks Comments Notes It often contains important data stored in an inconsistent, verbal and verbose way A typical use is to store data on a customer’s interests. Such a column may: Be used inconsistently Hold multiple data items