Assignment#5 Normalization.

Slides:



Advertisements
Similar presentations
5 5 Normalization of Database Tables Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Advertisements

Chapter 5 Normalization of Database Tables
Chapter 5 Normalization of Database Tables
RJP/RDA 1 /93 Relational Data Analysis (RDA) RDA organises all the system’s data items into a set of well NORMALISED relations. These should avoid: 1.
Normalization 如何將表格切割而不造成資料遺失.
Chapter 8 Normalization. © 2001 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Outline Modification anomalies Functional dependencies.
1 Database Systems: A Practical Approach to Design, Implementation and Management International Computer Science S. Carolyn Begg, Thomas Connolly Lecture.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Normalization I.
July 14, 2015ICS 424: recap1 Relational Database Design: Recap of ICS 324.
NORMALIZATION N. HARIKA (CSC).
Ch 7: Normalization-Part 2 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
 Th ờ i gian thi: 90 phút  Hình th ứ c thi: lý thuy ế t (tr ắ c nghi ệ m + tr ả l ờ i ng ắ n) + bài t ậ p (đ ề m ở )  C ấ u trúc bài thi: ◦ A. Lý thuy.
Normalization. 2 Objectives u Purpose of normalization. u Problems associated with redundant data. u Identification of various types of update anomalies.
Normalization A technique that organizes data attributes (or fields) such that they are grouped to form stable, flexible and adaptive entities.
Announcements Read 5.8 – 5.13 for Monday Project Step 3, due Monday 10/18 Homework 4, due Friday 10/15 – by (or turn in Monday in class)
1 Pertemuan 23 Normalisasi Matakuliah: >/ > Tahun: > Versi: >
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Lecture9:Functional Dependencies and Normalization for Relational Databases Prepared by L. Nouf Almujally Ref. Chapter Lecture9 1.
CSC271 Database Systems Lecture # 28.
Normal Forms through BCNF CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Lecture No 14 Functional Dependencies & Normalization ( III ) Mar 04 th 2011 Database Systems.
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
Database Design – Lecture 9 Normalization Continued.
Lecture9:Functional Dependencies and Normalization for Relational Databases Ref. Chapter Lecture9 1.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Normalization. 2 u Main objective in developing a logical data model for relational database systems is to create an accurate representation of the data,
The Normal Forms 3NF and BCNF
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Normalization ACSC 425 Database Management Systems.
ITD1312 Database Principles Chapter 4C: Normalization.
Database Architecture Normalization. Purpose of Normalization A technique for producing a set of relations with desirable properties, given the data requirements.
Normalization Or theoretical and common sense approaches to redesigning a database.
1 CS490 Database Management Systems. 2 CS490 Database Normalization.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
CS 3630 Database Design and Implementation
Normalization.
Normalization DBMS.
Chapter 7 Normalization Chapter 14 & 15 in Textbook.
Payroll Management System
3.1 Functional Dependencies
Normalization Lecture 7 May Aldoayan.
CS 3630 Database Design and Implementation
Relational Design Theory
Examples of normalization
Normalization.
Chapter 7 Normalization Chapter 13 in Textbook.
Table Normal Forms.
Normalization – Part II
Some Normalization Examples
Examples of normalization
Outline: Normalization
CS 3630 Database Design and Implementation
Normalization.
Relational Design Theory
Chapter 8 – Part2 Database Design.
Chapter 14 Normalization.
Chapter 8 – Part2 Database Design.
System Analysis and Design
Normalization February 28, 2019 DB:Normalization.
Database Normalisation
Normalization of DB relations examples Fall 2015
Logical Data Modeling – Normalization
Database Design Theory CS405G: Introduction to Database Systems
Assignment#4 Normalization.
BTEC ICT – Unit 18 With Mr Griffiths.
Some Normalization Examples
Presentation transcript:

Assignment#5 Normalization

Q1 Identify the functional dependencies. Describe and illustrate the process of normalization to produce 3NF relations. Identify the primary, alternate, and foreign keys in your 3NF relations.

UNF: -Because there is a repeating group  ( DrugNumber, DrugName, Description, Dosage, MethodOfAdmin, UnitPerDay, StartDate, FinishDate ) -The intersection of each row and columns might contain more than ONE value. R = ( FullName, PatientNumber, BedNumber, WardNumber, WardName, { DrugNumber, DrugName, Description, Dosage, MethodOfAdmin, {UnitPerDay, StartDate, FinishDate} }) 1NF: -Remove the repeating group using Approach#1 - expanding the key Patient_Medication ( FullName, PatientNumber, BedNumber, WardNumber, WardName, DrugNumber, DrugName, Description, Dosage, MethodofAdmin, UnitPerDay, StartDate, FinishDate )

Patient_Medication ( FullName, PatientNumber, BedNumber, WardNumber, WardName, DrugNumber, DrugName, Description, Dosage, MethodofAdmin, UnitPerDay, StartDate, FinishDate ) 2NF: PatientNumberfullName Partial Dependency WardNumberWardName Transitive Dependency DrugNumber  name , Description, Dosage, MethodOfAdmin Partial Dependency PateintNumber ,DrugNumber, startDate WardNumber, BedNumber, UnitPerDay, FinishDate PatientNumber,WardNumber,starDateBedNumber 2NF : FD1 & FD3 violate 3NF- Transitive dependency Patient (PatientNumber,fullName) Drug (DrugNumber , name , Description, Dosage, MethodOfAdmin ) Patient_Medication ( PateintNumber ,DrugNumber, startDate ,WardNumber, WardName, BedNumber, UnitPerDay, FinishDate)

Patient (PatientNumber,fullName) Drug (DrugNumber , name , Description,Dosage,MethodOfAdmin ) Patient_Medication ( PateintNumber ,DrugNumber, startDate , WardNumber, WardName, BedNumber, UnitPerDay, FinishDate) 3NF: PatientNumberfullName WardNumberWardName Transitive Dependency DrugNumber  name , Description , Dosage, MethodOfAdmin PateintNumber ,DrugNumber, startDateWardNumber, BedNumber, UnitPerDay, FinishDate PatientNumber,WardNumber,starDateBedNumber 3NF : FD2 violates 3NF- Transitive dependency Patient (PatientNumber,fullName) Drug (DrugNumber , name , Description , Dosage, MethodOfAdmin ) Patient_Medication ( PateintNumber ,DrugNumber, startDate , WardNumber, BedNumber, UnitPerDay, FinishDate) Ward(WardNumber,WardName)

Patient (PatientNumber,fullName) Drug (DrugNumber , name , Description,Dosage,MethodOfAdmin ) Patient_Medication ( PateintNumber ,DrugNumber, startDate , WardNumber, BedNumber, UnitPerDay, FinishDate) Ward(WardNumber,WardName) BCNF(not required in the Question) PatientNumberfullName WardNumberWardName DrugNumber  name , Description , Dosage, MethodOfAdmin PateintNumber ,DrugNumber, startDate WardNumber, BedNumber, UnitPerDay, FinishDate PatientNumber,WardNumber,starDateBedNumber BCNF : FD5 violates BCNF Patient (PatientNumber,fullName) Drug (DrugNumber , name , Description , Dosage, MethodOfAdmin ) Patient_Medication ( PateintNumber ,DrugNumber, startDate , WardNumber, UnitPerDay, FinishDate) Ward(WardNumber,WardName) Patient_Bed(PatientNumber,WardNumber,starDate,BedNumber)  

Q2 Consider the following relation: R=(CourseNo, SectionNo, OfferingDept, Credit-Hours, CourseLevel, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)   Suppose the following FDs hold on R: CourseNo → OfferingDept, CreditHours, CourseLevel CourseNo, SectionNo, Semester, year → Days_Hours, RoomNo, NoofStudents, InstructorSSN RoomNo, Days_Hours, Semester, Year → InstructorSSN, CourseNo, SectionNo -According to the given FDs and CK selection rules, the PK should be (CourseNo, SectionNo, Semester, year ). To check for 2NF the primary key needs to be defined. R(CourseNo, SectionNo, OfferingDept, Credit-Hours, CourseLevel, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)

Q2 Consider the following relation: R=(CourseNo, SectionNo, OfferingDept, Credit-Hours, CourseLevel, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)   Suppose the following FDs hold on R: CourseNo → OfferingDept, CreditHours, CourseLevel Partial Dependency CourseNo, SectionNo, Semester, year → Days_Hours, RoomNo, NoofStudents, InstructorSSN RoomNo, Days_Hours, Semester, Year → InstructorSSN, CourseNo, SectionNo -According to the given FDs and CK selection rules, the PK should be (CourseNo, SectionNo, Semester, year ). 1NF Course(CourseNo, SectionNo, OfferingDept, Credit-Hours, CourseLevel, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)

Q2 Course (CourseNo, SectionNo, OfferingDept, Credit-Hours, CourseLevel, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents) CourseNo → OfferingDept, CreditHours, CourseLevel Partial Dependency CourseNo, SectionNo, Semester, year → Days_Hours, RoomNo, NoofStudents, InstructorSSN RoomNo, Days_Hours, Semester, Year → InstructorSSN, CourseNo, SectionNo 2NF: FD1 violates the 2NF-Partial dependency . Course (CourseNo , OfferingDept, CreditHours, CourseLevel ) Course_Teaching (CourseNo, SectionNo, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)

Q2 Course (CourseNo , OfferingDept, CreditHours, CourseLevel ) Course _Teaching (CourseNo, SectionNo, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents) CourseNo → OfferingDept, CreditHours, CourseLevel Partial Dependency CourseNo, SectionNo, Semester, year → Days_Hours, RoomNo, NoofStudents, InstructorSSN RoomNo, Days_Hours, Semester, Year → InstructorSSN, CourseNo, SectionNo 3NF: Thers is no Transitive dependency  no viloation for 3NF Course (CourseNo , OfferingDept, CreditHours, CourseLevel ) Course_Teaching (CourseNo, SectionNo, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents)

Q2 Course (CourseNo , OfferingDept, CreditHours, CourseLevel ) Course _Teaching (CourseNo, SectionNo, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents) CourseNo → OfferingDept, CreditHours, CourseLevel Partial Dependency CourseNo, SectionNo, Semester, year → Days_Hours, RoomNo, NoofStudents, InstructorSSN RoomNo, Days_Hours, Semester, Year → InstructorSSN, CourseNo, SectionNo BCNF: FD3 viloates BCNF where the determinant in a nontrivial FD is not a CK. Course (CourseNo , OfferingDept, CreditHours, CourseLevel ) Course_Teaching (CourseNo, SectionNo, InstructorSSN, Semester, Year, Days_Hours, RoomNo, NoofStudents) Room_Course (RoomNo, Days_Hours, Semester, Year , InstructorSSN, CourseNo, SectionNo)