Component 4/Unit 6d Topic IV: Design a simple relational database using data modeling and normalization Description and Information Gathering Data Model.

Slides:



Advertisements
Similar presentations
Database Tables and Normalization
Advertisements

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?
Relational Database Appendix
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.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
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
Chapter 3 The Relational Model and Normalization
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
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.
Component 4/Unit 6f Topic VI: Create simple querying statements for the database The SELECT statement Clauses Functions Joins Subqueries Data manipulation.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
CBAD2103 Data Analysis and Modeling. Chapter 7 Conceptual Design Methodology.
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.
Component 4: Introduction to Information and Computer Science Unit 6: Databases and SQL Lecture 4 This material was developed by Oregon Health & Science.
Database Systems: Design, Implementation, and Management Tenth Edition
Module Title? DBMS Normalization. Module Title? DBMS Normalization  Normalization is the process of removing redundant data from tables in order to improve.
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.
Concepts of Database Management, Fifth Edition
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.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 5 Normalization of Database.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Normalization Copyright © 1999 Patrick McDermott College of Alameda
In this chapter, you learn about the following: ❑ Anomalies ❑ Dependency and determinants ❑ Normalization ❑ A layman’s method of understanding normalization.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
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.
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.
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
Database Principles: Fundamentals of Design, Implementation, and Management Ninth Edition Chapter 6 Normalization of Database Tables Carlos Coronel, Steven.
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.
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.
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
Relational Model and ER Model: in a Nutshell
Chapter 4 The Relational Model and Normalization
Presentation transcript:

Component 4/Unit 6d 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

Description of Database The database we are going to design is to keep track of new medications that are in trial testing. We need to keep track of the medications, the trials for those medications and the clinical institutions that are doing the testing. Component 4/Unit 6d2 Health IT Workforce Curriculum Version 1.0/Fall 2010

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 –Contact information –Address Component 4/Unit 6d3 Health IT Workforce Curriculum Version 1.0/Fall 2010

Information Gathering Continued 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 Information about the medication needed from the database. Component 4/Unit 6d4 Health IT Workforce Curriculum Version 1.0/Fall 2010

Data Model - First Attempt Next the database is normalized. Component 4/Unit 6d5 Health IT Workforce Curriculum Version 1.0/Fall 2010

Normalization A database is normalized to eliminate data anomalies. –Deletion anomaly –Insertion anomaly Functional dependencies Constraints –Data rules that must be followed Referential Integrity Constraint Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Functional Dependencies Data within a row can be shown to be dependent on a candidate key Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Referential Integrity Constraint An attribute of one entity is a subset of an attribute of another entity. Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

First Normal Form (1NF) Definition of a relation –Data rows within an entity must be unique and connected to the entity (can’t have data in a relation that is associated with something else). –Columns are uniquely named and contain only one piece of data (attribute) –The sequence of rows and columns is not important. Component 4/Unit 6d9 Health IT Workforce Curriculum Version 1.0/Fall 2010

Putting the Example database in First Normal Form There is nothing to indicate that rows in the entities are not unique and the attributes are connected to each entity Columns are uniquely named, but Address in the entity ClinicalTrialInstitution contains more than one piece of data (Street, City, State and Zip) Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Putting a Database In 1NF Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Second Normal Form (2NF) The second normal form 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 a composite keys. To be in second normal form attributes must be dependent on the whole key. Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Second Normal Form Continued A relation is in second normal form if all its non-key attributes are dependent on the entire key. A relation in second normal form must also be in first normal form. Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Putting The Trial DB In 2NF Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Putting The Trial DB In 2NF Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Third Normal Form (3NF) The third normal form 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 This indirect dependency on the key is called a transitive dependency Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Third Normal Form Continued A database is said to be in third normal form if there are no transitive dependencies A database in third normal form must also be in second and first normal forms Many Database Administrators (DBA) consider third normal form to be sufficient for most business and health care databases. Putting the database in a higher level of normalization may actually make the database less efficient. Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Putting The Trial DB In 3NF Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Trial DB In 3NF Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Other Normal Forms DBAs sometimes have to troubleshoot problems and on occasion will use normal forms beyond third normal form. A database can be de-normalized to solve some slow response problems. Boyce-Codd Normal Form –A determinant is an attribute that determines another attribute –DB is in Boyce-Codd form if every determinant is a candidate key Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Other Normal Forms Fourth Normal Form –Fixes an update anomaly that involves a multi-value dependency –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. –This situation is rare –DB is in 4 th normal form when there are no multi-value dependencies Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

Other Normal Forms Fifth Normal Form or Project-Join Normal Form (PJNF) –Generalization of multi-valued dependencies –Difficult to deal with –Extremely rare Domain Key Normal Form (DKNF) –Generalization of other non-time constraints –Difficult to deal with and rarely used Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall

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

Final Design of the Trial DB Component 4/Unit 6d Health IT Workforce Curriculum Version 1.0/Fall