CS317 File and Database Systems

Similar documents
Chapter 14. Chapter 14 - Objectives. Purpose of Normalization. Purpose of Normalization

Chapter 3. The Relational database design

Normalisation. Normalisation. Normalisation

Normalization. { Ronak Panchal }

CS317 File and Database Systems

CS317 File and Database Systems

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

CS317 File and Database Systems

CS317 File and Database Systems

CS317 File and Database Systems

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

DBMS Chapter Three IS304. Database Normalization-Comp.

CS317 File and Database Systems

CS317 File and Database Systems

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design

Database Normalization

Lecture4: Guidelines for good relational design Mapping ERD to Relation. Ref. Chapter3

Lecture 03. Spring 2018 Borough of Manhattan Community College

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

IS 263 Database Concepts

2.2.2.Relational Database concept

Informal Design Guidelines for Relational Databases

Transforming ER to Relational Schema

In This Lecture. Normalisation to BCNF. Lossless decomposition. Normalisation so Far. Relational algebra reminder: product

Lecture5 Functional Dependencies and Normalization for Relational Databases

Lecture 03. Fall 2017 Borough of Manhattan Community College

Database Technologies. Madalina CROITORU IUT Montpellier

NJIT Department of Computer Science PhD Qualifying Exam on CS 631: DATA MANAGEMENT SYSTEMS DESIGN. Summer 2012

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

This lecture. Databases -Normalization I. Repeating Data. Redundancy. This lecture introduces normal forms, decomposition and normalization.

CS317 File and Database Systems

Database Normalization

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)

A subquery is a nested query inserted inside a large query Generally occurs with select, from, where Also known as inner query or inner select,

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<


Database Systems Redundancy, normalization

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Databases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2

Chapter 14 Outline. Normalization for Relational Databases: Outline. Chapter 14: Basics of Functional Dependencies and

CONSTRAINTS AND UPDATES CHAPTER 3 (6/E) CHAPTER 5 (5/E)

S emistructured Data & XML

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Relational Databases Overview

3ISY402 DATABASE SYSTEMS

Chapter 4. The Relational Model

RELATIONAL DATA MODEL

CS530 Database Architecture Models. Database Model. Prof. Ian HORROCKS. Dr. Robert STEVENS. and Design The Relational

CS121 MIDTERM REVIEW. CS121: Relational Databases Fall 2017 Lecture 13

Physical Database Design

Chapter 2 Introduction to Relational Models

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

Unit 3 : Relational Database Design

Introduction to MS Access: creating tables, keys, and relationships

CMP-3440 Database Systems

Institute of Southern Punjab, Multan

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

Microsoft Office Access 2007: Intermediate Course 01 Relational Databases

The Relational Model and Normalization

ER Model. Objectives (2/2) Electricite Du Laos (EDL) Dr. Kanda Runapongsa Saikaew, Computer Engineering, KKU 1

Multi-CPU and distributed systems. Database system architectures. Lecture topics: monolithic systems client server systems parallel database servers

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #5: Entity/Relational Models---Part 1

The Entity-Relationship Model (ER Model) - Part 2

CS317 File and Database Systems

Relational Data Model ( 관계형데이터모델 )

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

Objective. The goal is to review material covered in Chapters 1-5. Do the following questions from the book.

Schema Refinement: Dependencies and Normal Forms

Lecture 11 - Chapter 8 Relational Database Design Part 1

Introduction to Data Management. Lecture #5 Relational Model (Cont.) & E-Rà Relational Mapping

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

Relational Database design. Slides By: Shree Jaswal

Schema Refinement: Dependencies and Normal Forms

Edited by: Nada Alhirabi. Normalization

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, normal forms. University of Edinburgh - January 25 th, 2016

Chapter 1: Introduction

CS275 Intro to Databases

CSE 544 Principles of Database Management Systems

Database Technology Introduction. Heiko Paulheim

The data structures of the relational model Attributes and domains Relation schemas and database schemas

CS425 Midterm Exam Summer C 2012

DB Creation with SQL DDL

Data, Information, and Databases

Running Example Tables name location

Databases. Jörg Endrullis. VU University Amsterdam

COSC344 Database Theory and Applications. σ a= c (P) Lecture 3 The Relational Data. Model. π A, COSC344 Lecture 3 1

S.Y.B.Sc. (CS) PAPER - III, Section - I Data Base Management Systems

Lecture 6 Structured Query Language (SQL)

A Deeper Look at Data Modeling. Shan-Hung Wu & DataLab CS, NTHU

DATABASE MANAGEMENT SYSTEMS. UNIT I Introduction to Database Systems

Database Management System

CS2300: File Structures and Introduction to Database Systems

Database Systems Relational Model. A.R. Hurson 323 CS Building

COMM 391. Objectives. Introduction to Microsoft Access. What is in an Access database file? Introduction to Microsoft Access 2010

Transcription:

CS317 File and Database Systems http://dilbert.com/strips/comic/2010-08-24/ Lecture 8 Introduction to Normalization October 17, 2017 Sam Siewert

Exam #1 Questions? Reminders Working on Grading Ex #3 - Return Next Week Grading Breakdown here - http://mercury.pr.erau.edu/~siewerts/cs317/policies/grad ing-breakdown.pdf Assignment #4, Wednesday, Normalization Assignment #5, Logical and Physical DB Design Assignment #6, DBMS Project of Your Interest Sam Siewert 2

Normalization Concern is Duplication of Data in DBMS Wastes Space Insert Hazard (Update Multiple Tables?) Delete Hazard (Delete from Multiple Tables?) Modification Hazard (Modify in Multiple Tables?) Foreign Keys are Exception (Expected Redundancy for Relational Model) Minimal Attributes (Columns in Relations [Tables]) Attributes in Table with Close Logical Relationship Functionally Dependent Attributes in Same Relation Models of Functional Dependency Minimal Redundancy [Foreign Keys Only] Sam Siewert 3

How Normalization Supports Database Design (Ref. Connolly-Begg) 4

Data Redundancy and Update Anomalies FK Duplication [ok] Redundant Attribute Data 5

Example Functional Dependency that holds for all Time Consider the values shown in staffno and sname attributes of the Staff relation (previous slide). Based on sample data, the following functional dependencies appear to hold. staffno sname sname staffno 6

Data Redundancy and Update Anomalies StaffBranch relation has redundant data; the details of a branch are repeated for every member of staff. In contrast, the branch information appears only once for each branch in the Branch relation and only the branch number (branchno) is repeated in the Staff relation, to represent where each member of staff is located. 7

Duplicate Data and Update Anomalies Relations that contain redundant information may suffer from update anomalies. 3 update anomalies Row Insertion Enter SL99 assinged B003 fat finger baddress SG37, SG14, SG5 share with SL99 Which one is right? Deletion Delete SA9 (fired) What is baddress of B007? Do we still have B007? Modification Correct Bad Street # for Deer Rd. Which row - SL21 or SL41 row? updates 8

Lossless-join and Dependency Preservation Properties Two important properties of decomposition. Lossless-join property enables us to find any instance of the original relation from corresponding instances in the smaller relations. I can create UNF table as a view if I want to! Dependency preservation property enables us to enforce a constraint on the original relation by enforcing some constraint on each of the smaller relations. E.g. Domain, Referential Integrity (all staff must have one branch assignment), StaffNo must be unique, etc. 9

Functional Dependencies Important concept associated with normalization. Functional dependency describes relationship between attributes. For example, if A and B are attributes of relation R, B is functionally dependent on A (denoted A B), if each value of A in R is associated with exactly one value of B in R. 10

Characteristics of Functional Dependencies Property of the meaning or semantics of the attributes in a relation. Diagrammatic representation. The determinant of a functional dependency refers to the attribute or group of attributes on the lefthand side of the arrow. 11

An Example Functional Dependency 12

Characteristics of Functional Dependencies Full functional dependency indicates that if A and B are attributes of a relation, B is fully functionally dependent on A, if B is functionally dependent on A, but not on any proper subset of A. E.g. Branch assignment does not depend on your salary or position, just who you are 13

Functional Dependencies Determinants with minimal number of attributes necessary to maintain the functional dependency with the attribute(s) on the right hand-side. E.g. A staff member is assigned to one and only one branch. A branch has many staff members assigned to it. This requirement is called full functional dependency. 14

Full vs. Partial Functional Dependency Staff relation: staffno, sname branchno Each value of (staffno, sname) is associated with a single value of branchno. However, branchno is also functionally dependent on a subset of (staffno, sname), namely staffno. Example above is a partial dependency (name irrelevant) 15

Better Staff Branch Relations Full functional assigned to only one Partial functional assigned to only one E.g. Two employees named John White SL21 & New John White as SL100 SL21 -> B005 SL100 -> B099 16

Transitive Dependencies Important to recognize a transitive dependency because its existence in a relation can potentially cause update anomalies. Transitive dependency describes a condition where A, B, and C are attributes of a relation such that if A B and B C, then C is transitively dependent on A via B (provided that A is not functionally dependent on B or C). 17

Example Transitive Dependency Consider functional dependencies in the StaffBranch relation (see Slide 17). staffno sname, position, salary, branchno, baddress branchno baddress Transitive dependency, branchno baddress exists on staffno via branchno. 18

Better Staff Branch Relations assigned to only one has only one address Branch address of StaffNo is transitive 19

The Process of Normalization 20

The Process of Normalization 21

Unnormalized Form (UNF) A table that contains one or more repeating groups. Worst case May also have Full/Partial Functional Dependencies May also have Transitive Functional Dependencies E.g. Most Excel Spreadsheets!!! 22

Case in Point Omission of data Would an RDBMS have caught? Perhaps if data for plot was queried from well formed schema? Spreadsheets tend to use ranges rather than predicates Reinhart, Rogoff... and Herndon: The student who caught out the profs BBC News story Sam Siewert 23