1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.

Slides:



Advertisements
Similar presentations
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Advertisements

Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Normalization of Database Tables
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 5 The Relational Model and Normalization.
Chapter 5 Normalization of Database Tables
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
NORMALIZATION N. HARIKA (CSC).
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
LOGICAL DATABASE DESIGN
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Module Title? DBMS E-R Model to Relational Model.
Week 6 Lecture Normalization
Functional Dependencies
MIS 301 Information Systems in Organizations Dave Salisbury ( )
CODD’s 12 RULES OF RELATIONAL DATABASE
MIS 301 Information Systems in Organizations Dave Salisbury ( )
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Database Systems: Design, Implementation, and Management Tenth Edition
RDBMS Concepts/ Session 3 / 1 of 22 Objectives  In this lesson, you will learn to:  Describe data redundancy  Describe the first, second, and third.
Concepts of Database Management, Fifth Edition
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
King Saud University College of Computer & Information Sciences Computer Science Department CS 380 Introduction to Database Systems Functional Dependencies.
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
1 DATABASE SYSTEMS DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT Chapter 7 Normalisation.
Normalization (Codd, 1972) Practical Information For Real World Database Design.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Functional Dependencies and Normalization for Relational Databases.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Lecture 8: Database Concepts May 4, Outline From last lecture: creating views Normalization.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
Chapter 7 Functional Dependencies Copyright © 2004 Pearson Education, Inc.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Logical Database Design and the Relational Model.
Ch 7: Normalization-Part 1
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 1 Normalization DB Design Guidelines Presented by: Dr. Samir Tartir.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
1 Information Retrieval and Use De-normalisation and Distributed database systems Geoff Leese September 2008, revised October 2009.
NORMALIZATION Handout - 4 DBMS. What is Normalization? The process of grouping data elements into tables in a way that simplifies retrieval, reduces data.
Logical Database Design and Relational Data Model Muhammad Nasir
SLIDE 1IS 257 – Fall 2006 Normalization Normalization theory is based on the observation that relations with certain properties are more effective.
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 The Relational Data Model David J. Stucki. Relational Model Concepts 2 Fundamental concept: the relation  The Relational Model represents an entire.
Chapter 15 1 Functional Dependencies and Normalization for Relational Databases تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
1 Normalization David J. Stucki. Outline Informal Design Guidelines Normal Forms  1NF  2NF  3NF  BCNF  4NF 2.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
Understanding Data Storage
Normalization Karolina muszyńska
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Database Normalization
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
A SIMPLE GUIDE TO FIVE NORMAL FORMS (See the next slide for required reading) Prof. Ghandeharizadeh 2018/11/14.
Normalization Referential Integrity
Relational Database Model
Normalization DB Design Guidelines Presented by: Dr. Samir Tartir
Chapter 15 Basics of Functional Dependencies and Normalization for Relational Databases.
Presentation transcript:

1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level

2 Logical Design Define the Relations and Attributes for a Relational Database Key problems:  What tables will there be?  What columns will each table have? Additional issue:  Where will Integrity Constraints be enforced Intrinsic (Database design), Triggers and other DBMS mechanisms, Application

3 Outline Informal Guidance First Normal Form Functional Dependencies and Second, Third and Boyce-Codd Normal Forms Join Dependencies and Fourth and Fifth Normal Forms Material from Chapters 10 and 11 in Text Book

4 “Informal” Guidance Informal means: without a formal (i.e. mathematical) theory Outline:  Keep to real world semantics  Avoid redundant information Avoid update anomalies  Minimize use of null values  Avoid generation of spurious tuples

5 Real World Semantics (To the extent possible) Your design should track the semantics of the real world  “Database is a record of executed policy”  Each relation should correspond to a single real world concept (e.g. Person) Attributes should be attributes of that real world concept  Each attribute of each relation should correspond to an independent real world fact You should be able to easily explain to the user the meaning of all the relations and attributes  You should choose semantically meaningful names

6 Avoid Redundant Information and Update Anomalies See Figures 10.3 and 10.4 for examples Insertion Anomalies  Can’t insert data without having the redundant information available (or filling with nulls)  No way to insert a (false) subentity without inserting the parent (e.g. Department can’t exist if they have no Employees) Deletion Anomalies  May delete a (false) subentity (e.g. delete a department by deleting the last employee)

7 Update Anomalies (Continued) Modification (Update) Anomalies  Must change an attribute in all the duplicated locations or have multiple versions of same fact Bottom line: 1. Design the database to avoid Update Anomalies 2. If not, document the discrepancies and make sure that these are handled correctly by applications that update the database Data is sometimes duplicated to improve performance

8 Minimize use of null values Problem: null may mean:  Value is not applicable  Value is not known  Value is missing  Value will be provided later Another problem: Large numbers of nulls can waste space Advice:  Try to avoid null values  Restrict null to exceptional cases  Use a separate table when nulls are common This usually implies either a class/sub-class relationship or an entity with multiple states

9 Avoid Generation of Spurious Tuples Natural Joins should represent True facts See example Figures 10.5 and 10.6 Equi-joins of non-key attributes (primary or foreign keys) are problematic  Non-key attributes represent unique facts associated with the entity designated by the key Advice:  Design relations so that they are joined via primary or foreign keys

10 Normal Forms Formal basis for design of database First normal form  Follows Relational Model Second, Third, and Boyce-Codd Normal Forms  Individual relations have the right keys Fourth and Fifth Normal Forms  Multi-value and Join dependencies  Collection of Relations behave correctly

11 Practical Guidance on Normal Forms Do a preliminary design of the database first  Use ER modeling and your understanding of the problem  Follow the informal guidance Check that the design observes normalization rules  Iterate when there is a “bug” in the design  Document discrepancies you choose to accept If performance becomes a problem, consider “denormalization” of the database  Most frequent denormalization: Storing joins  Beware premature optimization

12 First Normal Form “Tables are square”  No repeated values  No variant records Today: This is part of the relational model When Codd defined it: This was counter to standard practice Tomorrow: Object-Relational and XML databases allow repeated values See Figure 10.9 for example

13 Fixing First Normal Form Violations Possible strategies: 1. (Preferred) Create a new table to store multi- valued attributes 2. Repeat the whole tuple for each value Usually creates redundancy problems and update anomalies 3. Store the values as multiple attributes in a single tuple Requires knowing the maximum number of values or creating overflow relations Creates problems when querying the database 4. Code multiple values into a single string Yuck!