Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.

Slides:



Advertisements
Similar presentations
Chapter 5 Normalization of Database Tables
Advertisements

Database Tables and Normalization
Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
© 2002 by Prentice Hall 1 SI 654 Database Application Design Winter 2003 Dragomir R. Radev.
Normalization What is it?
The Relational Model System Development Life Cycle Normalisation
Fundamentals, Design, and Implementation, 9/e Chapter 4 The Relational Model and Normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 3-1 COS 346 Day 5.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normalization of Database Tables
Database Normalization Il-Han Yoo CS 157A Professor: Sin-Min Lee.
Normalization of Database Tables
© 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
Introduction to Information and Computer Science Databases and SQL Lecture b This material (Comp4_Unit6b) was developed by Oregon Health & Science University,
Chapter 3 The Relational Model and Normalization
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Lecture 12 Inst: Haya Sammaneh
SQL Normalization Database Design Lecture 5. Copyright 2006Page 2 SQL Normalization Database Design 1 st Normal Form 1 st Normal Form 2 nd Normal Form.
A Guide to SQL, Eighth Edition Chapter Two Database Design Fundamentals.
KROENKE and AUER - DATABASE CONCEPTS (3 rd Edition) © 2008 Pearson Prentice Hall 5-1 Chapter Objectives Learn how to transform E-R data models into relational.
Functional Dependence An attribute A is functionally dependent on attribute(s) B if: given a value b for B there is one and only one corresponding value.
Concepts and Terminology Introduction to Database.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
Fundamentals, Design, and Implementation, 9/e. Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/2 Copyright.
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 2 This material was developed by Oregon Health & Science.
IT420: Database Management and Organization Normalization 31 January 2006 Adina Crăiniceanu
© 2002 by Prentice Hall 1 Database Design David M. Kroenke Database Concepts 1e Chapter 5 5.
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.
Chapter 4 The Relational Model and Normalization.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables.
1 A Guide to MySQL 2 Database Design Fundamentals.
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.
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Normalization Well structured relations and anomalies Normalization First normal form (1NF) Functional dependence Partial functional dependency Second.
1 A Guide to MySQL 2 Database Design Fundamentals.
What's a Database A Database Primer Let’s discuss databases n Why they are hard n Why we need them.
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
Database Design Chapter Five DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.
In this session, you will learn to: Describe data redundancy Describe the first, second, and third normal forms Describe the Boyce-Codd Normal Form Appreciate.
Relational Model & Normalization Relational terminology Anomalies and the need for normalization Normal forms Relation synthesis De-normalization.
Database Processing: Fundamentals, Design and Implementation, 9/e by David M. KroenkeChapter 4/1 Copyright © 2004 Please……. No Food Or Drink in the class.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 6 This material was developed by Oregon Health & Science.
1 CS 430 Database Theory Winter 2005 Lecture 7: Designing a Database Logical Level.
RELATIONAL TABLE NORMALIZATION. Key Concepts Guidelines for Primary Keys Deletion anomaly Update anomaly Insertion anomaly Functional dependency Transitive.
Lecture 4: Logical Database Design and the Relational Model 1.
Week 4 Lecture Part 1 of 3 Normalization of Database Tables Samuel ConnSamuel Conn, Asst. Professor.
IMS 4212: Normalization 1 Dr. Lawrence West, Management Dept., University of Central Florida Normalization—Topics Functional Dependency.
Databases Introduction - concepts. Concepts of Relational Databases.
Introduction to Information and Computer Science Databases and SQL Lecture d This material (Comp4_Unit6d) was developed by Oregon Health & Science University,
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.
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
Revised: 2 April 2004 Fred Swartz
Normalization Karolina muszyńska
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Relational Model and ER Model: in a Nutshell
Chapter 4 The Relational Model and Normalization
Presentation transcript:

Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number IU24OC

Topic IV: Design a Simple Relational Database using Data Modeling and Normalization Description and Information Gathering Data Model Normalization, Functional Dependencies and Constraints Final design, Relationships, Primary keys and Foreign keys Health IT Workforce Curriculum Version 2.0/Spring 2011 Component 4/Unit 6-4 2

Description of Database Keep track of new medications that are in trial testing. Keep track of the medications, the trials for those medications and the clinical institutions doing the testing. 3 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Information Gathering Through meetings with users and looking at forms and reports it was determined that certain data about a clinical institution needed to be kept in the data base. – Name of the institution –Address –Contact information 4 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Information Gathering Continued Keep track of medications and trials: Drug name Drug creator Date of Creation Drug family Drug use Drug description Trial code Trial start date Trial end date Trial results description Trial cost resource Component 4/Unit 6-4Health IT Workforce Curriculum Version 2.0/Spring

Data Model - First Attempt 6 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Normalization A database is normalized to eliminate data anomalies: Insert, Delete, Update Functional dependencies Constraints –Data rules that must be followed Referential Integrity Constraint 7 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Functional Dependencies Data within a row can be shown to be dependent on a candidate key 8 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Referential Integrity Constraint An attribute of one entity is a subset of an attribute of another entity. 9 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

First Normal Form (1NF) Definition of a relation –Data rows within an entity must be unique and connected describe an instance of the entity (no data in a relation that is associated with something else). –Columns (attributes) are uniquely named, are of the same data type and will contain only one value. –The order of rows and columns is not important. 10 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Putting the Example database in First Normal Form Nothing indicates that rows in the entities are not unique Attributes are connected to each entity Columns are uniquely named ClinicalTrialInstitution address contains pieces of data (Street, City, State and Zip) 11 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Putting a Database In 1NF 12 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Second Normal Form (2NF) 2NF eliminates deletion and insertion anomalies that are due to having an attribute or attributes dependent on something other than the key. This is especially true for composite keys. To be in second normal form attributes must be dependent on the whole key. 13 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Second Normal Form Continued A relation is in 2NF if all its non-key attributes are dependent on the entire key. A relation in 2NF must also be in 1NF. 14 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Putting The Trial DB In 2NF 15 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Putting The Trial DB In 2NF 16 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Third Normal Form (3NF) 3NF eliminates deletion and insertion anomalies that are due to having an indirect dependency where an attribute is indirectly dependent on the key The attribute is directly dependent on an attribute that is dependent on the key The indirect dependency on the key is called a transitive dependency 17 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Third Normal Form Continued A database is said to be 3NF if there are no transitive dependencies A database in 3NF must also be in 2NF and 1NF Many Database Administrators (DBAs) consider 3NF to be sufficient for most business and health care databases. Putting the database in a higher level of normalization may make the database less efficient. 18 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Putting The Trial DB In 3NF 19 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Trial DB In 3NF 20 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Other Normal Forms DBAs troubleshoot problems and on occasion will use normal forms beyond 3NF. A database can be de-normalized to solve some slow response problems. Boyce-Codd Normal Form (BCNF) –A determinant is an attribute that determines another attribute –A database is in Boyce-Codd form if every determinant is a candidate key 21 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Other Normal Forms Fourth Normal Form (4NF) –This situation is rare –A multi-value dependency exists when there are a minimum of three attributes, two of the attributes are multi-valued and the values of the two multi-value attributes depend only on a 3rd attribute. –4NF fixes an update anomaly that involves a multi-value dependency –A database is in 4NF when there are no multi- value dependencies 22 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Other Normal Forms Fifth Normal Form (5NF) or Project-Join Normal Form (PJNF) –Extremely rare –Generalization of multi-valued dependencies –Difficult to deal with Domain Key Normal Form (DKNF) –Generalization of other non-time constraints –Difficult to deal with 23 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Evolution of the Data Model Data model progresses from being volatile with many changes to a database design with little change or surprises In the final design, entities become tables, relationships show minimum and maximum cardinality and primary/foreign keys are chosen 24 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011

Final Design of the Trial DB 25 Component 4/Unit 6-4 Health IT Workforce Curriculum Version 2.0/Spring 2011