Case Study: Lufthansa Cargo Database

Similar documents
Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization

Database Systems. Basics of the Relational Data Model

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

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization

CS411 Database Systems. 05: Relational Schema Design Ch , except and

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

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Final Review. Zaki Malik November 20, 2008

CSE 562 Database Systems

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

Functional dependency theory

Normalisation theory

Part II: Using FD Theory to do Database Design

Functional Dependencies CS 1270

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

Normalisation. Normalisation. Normalisation

Relational Design: Characteristics of Well-designed DB

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

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

Normalisation Chapter2 Contents

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

Redundancy:Dependencies between attributes within a relation cause redundancy.

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Design Theory and Normalization. CS 377: Database Systems

Lectures 5 & 6. Lectures 6: Design Theory Part II

Lecture 4. Database design IV. INDs and 4NF Design wrapup

ACS-2914 Normalization March 2009 NORMALIZATION 2. Ron McFadyen 1. Normalization 3. De-normalization 3

Normalization Rule. First Normal Form (1NF) Normalization rule are divided into following normal form. 1. First Normal Form. 2. Second Normal Form

Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please)

FUNCTIONAL DEPENDENCIES CHAPTER , 15.5 (6/E) CHAPTER , 10.5 (5/E)

Databases Lecture 7. Timothy G. Griffin. Computer Laboratory University of Cambridge, UK. Databases, Lent 2009

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

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

Informal Design Guidelines for Relational Databases

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

Theory of Normal Forms Decomposition of Relations. Overview

Concepts from

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

UNIT 3 DATABASE DESIGN

Database Normalization. (Olav Dæhli 2018)

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up

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

5 Normalization:Quality of relational designs

CSCI 403: Databases 13 - Functional Dependencies and Normalization

Functional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems

Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please)

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

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002

Databases 1. Daniel POP

Normalization in DBMS

The Relational Data Model

Schema Normalization. 30 th August Submitted By: Saurabh Singla Rahul Bhatnagar

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

Relational Database design. Slides By: Shree Jaswal

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

CS 338 Functional Dependencies

Combining schemas. Problems: redundancy, hard to update, possible NULLs

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

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, Normal Forms. University of Edinburgh - January 30 th, 2017

Database design III. Quiz time! Using FDs to detect anomalies. Decomposition. Decomposition. Boyce-Codd Normal Form 11/4/16

COSC Dr. Ramon Lawrence. Emp Relation

Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

CSIT5300: Advanced Database Systems

Design Theory for Relational Databases

CSE 544 Principles of Database Management Systems

Lecture 11 - Chapter 8 Relational Database Design Part 1

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

FUNCTIONAL DEPENDENCIES

Announcements (January 20) Relational Database Design. Database (schema) design. Entity-relationship (E/R) model. ODL (Object Definition Language)

Databases The theory of relational database design Lectures for m

Schema Refinement: Dependencies and Normal Forms

Final Examination Computer Science 420 Dr. St. John Lehman College City University of New York 21 May 2002

Exercise 9: Normal Forms

Bachelor in Information Technology (BIT) O Term-End Examination

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

CSE 544 Principles of Database Management Systems

CS211 Lecture: Database Design

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early!

Steps in normalisation. Steps in normalisation 7/15/2014

Relational Database Design (II)

Schema Refinement: Dependencies and Normal Forms

DATABASE MANAGEMENT SYSTEMS

Relational Design Theory. Relational Design Theory. Example. Example. A badly designed schema can result in several anomalies.

CS 2451 Database Systems: Database and Schema Design

Administrivia. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Relational Model: Keys. Correction: Implied FDs

Birkbeck. (University of London) BSc/FD EXAMINATION. Department of Computer Science and Information Systems. Database Management (COIY028H6)

BCNF. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong BCNF

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

Relational Database Systems 1

Relational Design 1 / 34

Lecture 5 Design Theory and Normalization

Edited by: Nada Alhirabi. Normalization

Functional Dependencies and Finding a Minimal Cover

Schema Refinement: Dependencies and Normal Forms

Transcription:

Case Study: Lufthansa Cargo Database Carsten Schürmann 1

Today s lecture More on data modelling Introduction to Lufthansa Cargo Database Entity Relationship diagram Boyce-Codd normal form 2

From Lecture 2: Data Modeling 3

From Lecture 3: Normalization So far: Start from scratch mentatility ER diagram Movies(title,year,length,filmType,studioName,starName) where the length of a movie is repeated several times (once for each starname). Obvious problem: Uses more memory than is necessary. 4

From Lecture 3: Normalization Principled approach to avoiding (or at least being aware of) anomalies in a database design. Captures situations where unrelated facts are placed in a single relation. Decompose (split) to avoid anomalies: Movies(title,year,length,filmType,studioName,starName) becomes Movies1(title,year,length,filmType,studioName) Movies2(title,year,starName) 5

Recall: Keys A candidate key for a relation is a set K of its attributes that satisfy: Uniqueness: The values of the attribute(s) in K uniquely identify a tuple. Minimality: The uniqueness property goes away if we remove any attribute from K. If uniqueness is satisfied the attributes are said to form a superkey. Example: For Movies, {Title,year,starName} is a candidate key. {Title,year,starName,length} is a superkey. {Title, year} is not a key. 6

Recall: Functional dependency (FD) We say that A (functionally) determines B, written A B, if the value of B is always determined by the value(s) of A (for any possible relation). Examples: cpr name in Person(cpr,name) title year length in Movie Non-example: title year starname does not hold for Movie 7

Normalization First normal form All data value are atomic Second normal form 1NF No non-key attribute is partially dependend on a candidate key Third normal form 2NF No non-key attribute depends transitively on a candidate key 8

Recall: Boyce-Codd Normal Form (BCNF) A relation R is in BCNF: A 1 A 2 A 3 A n -> B is a FD iff {A 1, A 2, A 3,,A n } is a superkey of R Example: Movies has the FD title year length where {title,year} is not a superkey. This means that Movies is not in BCNF. The anomalies we saw in Movies are in fact caused by the above FD! requires us to store the same movie length again and again. 9

Recall: Decomposing into BCNF Suppose relation R is not in BCNF. Then there is an FD A 1 A 2 A n B 1 B 2 B m that is not unavoidable. To eliminate the FD we split R into two relations: R1 with all attributes of R except B 1 B 2 B m. R2 with attributes A 1 A 2 A n B 1 B 2 B m. Note that A 1 A 2 A n is a superkey of R2, so a join recovers the original relation R. This process is repeated until all relations are in BCNF. 10

BCNF (Summary) A relation is in Boyce-Codd normal form if for every FD A B either B is contained in A (the FD is trivial), or A contains a candidate key of the relation, In other words: every determinant in a non-trivial dependency is a (super) key The same as 3NF except in 3NF we only worry about non-key Bs If there is only one candidate key then 3NF and BCNF are the same 11

Example [Zaki Malik 08] 12

Case Study 13

Raw data as CVS File 14

Guidelines 15

Understand Possible Queries! Can I ship my goods every Thursday? Is it possible to ship twice a week? Is enough capacity available? Can my goods reach a distination directly? How many flights go to Asia? 16

Understand Data! 17

Derive Functional Dependencies 18

Derive Functional Dependencies FNR, SNR -> DEP FNR, SNR -> ARR FNR, SN RD-> CD RA -> CA DEP -> RD ARR -> RA Group work 10 minutes! 19

BCNF normalization Take the big table and decompose! Formulate each decomposition Group work 10 minutes Draw ER diagram 20

History Preservation Databases are persistant and have state DB n Oerations (such as search, update, delete) op 1 21

History Preservation Standard evolution of the database op 1 op DB 1 DB 2 op 3 2 DB 3 DB 4 norm norm norm op 1 op 2 op 3 norm DB 1 DB 2 DB 3 DB 4 Simulated evolution of the normalized database 22

Semantic Transparency Very difficult to get right Simple case: Insertion of one record in the original DB May translate into several insertions Complex case: Complex transaction exist on the original DB How are these transactions translated? Yet necessary Normalization should be semantically transparent 23

Course goal After the course the students should be able to: Use tools so far to transform a live database into a new one, while reducing redundancy and preserving history 24

Next steps Exercises from 10:00 as usual. Will start by a TA presentation of some exercises from last week (<15 min.) Work on the first hand-in Next week: SQL 25