CS 405G: Introduction to Database Systems

Slides:



Advertisements
Similar presentations
Higher Normal Forms By John Nicosia CS 157a Fall 2007.
Advertisements

Functional Dependencies (FDs)
ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala N ATIONAL I NSTITUTE OF T ECHNOLOGY A GARTALA Aug-Dec,2010 Normalization 2 CSE-503 :: D ATABASE.
Manipulating Functional Dependencies Zaki Malik September 30, 2008.
Tutorial 8 CSI 2132 Database I. Exercise 1 Both disks and main memory support direct access to any desired location (page). On average, main memory accesses.
Temple University – CIS Dept. CIS616– Principles of Data Management V. Megalooikonomou Functional Dependencies (based on notes by Silberchatz,Korth, and.
Database Management COP4540, SCS, FIU Functional Dependencies (Chapter 14)
+ Review: Normalization and data anomalies CSCI 2141 W2013 Slide set modified from courses.ischool.berkeley.edu/i257/f06/.../Lecture06_257.ppt.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Jump to first page Normalization Jump to first page Topics n Why normalization is needed n What causes anomalies n What the 4 normal forms are n How.
Normalization DB Tuning CS186 Final Review Session.
Normalization DB Tuning CS186 Final Review Session.
Multivalued Dependency Prepared by Tomasz Kaciak CS157A.
DATABASE DESIGN Functional Dependencies. Overview n Functional Dependencies n Normalization –Functional dependencies –Normal forms.
1 Database Design Theory Which tables to have in a database Normalization.
Functional Dependencies (Part 3) Presented by Nash Raghavan All page numbers are in reference to Database System Concepts (5 th Edition)
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Cs3431 Normalization. cs3431 Why Normalization? To remove potential redundancy in design Redundancy causes several anomalies: insert, delete and update.
CS405G: Introduction to Database Systems Final Review.
Databases 6: Normalization
...Looking back Why use a DBMS? How to design a database? How to query a database? How does a DBMS work?
Functional Dependencies CS 186, Spring 2006, Lecture 21 R&G Chapter 19 Science is the knowledge of consequences, and dependence of one fact upon another.
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
Chapter 7: Relational Database Design. 7.2Unite International CollegeDatabase Management Systems Chapter 7: Relational Database Design Features of Good.
CS 405G: Introduction to Database Systems 18. Normal Forms and Normalization.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
Design Theory for Relational Databases 2015, Fall Pusan National University Ki-Joune Li.
SCUJ. Holliday - coen 1784–1 Schedule Today: u Normal Forms. u Section 3.6. Next u Relational Algebra. Read chapter 5 to page 199 After that u SQL Queries.
Computing & Information Sciences Kansas State University Tuesday, 27 Feb 2007CIS 560: Database System Concepts Lecture 18 of 42 Tuesday, 27 February 2007.
CS 564 Database Management Systems: Design and Implementation Discussion Session Friday, Sept 18, Apul Jain.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
Revisit FDs & BCNF Normalization 1 Instructor: Mohamed Eltabakh
CS 405G: Introduction to Database Systems 25 Exercise Chen Qian University of Kentucky.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo Lecture#16: Schema Refinement & Normalization.
1 Dept. of CIS, Temple Univ. CIS616/661 – Principles of Data Management V. Megalooikonomou Integrity Constraints (based on slides by C. Faloutsos at CMU)
© D. Wong Ch. 3 (continued)  Database design problems  Functional Dependency  Keys of relations  Decompositions based on Functional Dependency.
1 Functional Dependencies. 2 Motivation v E/R  Relational translation problems : –Often discover more “detailed” constraints after translation (upcoming.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
Functional Dependencies CIS 4301 Lecture Notes Lecture 8 - 2/7/2006.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
MIS 3053 Database Design And Applications The University Of Tulsa Professor: Akhilesh Bajaj Normal Forms Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003.
CS 405G: Introduction to Database Systems Database Normalization.
CS542 1 Schema Refinement Chapter 19 (part 1) Functional Dependencies.
CS411 Database Systems Kazuhiro Minami 04: Relational Schema Design.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
11/06/97J-1 Principles of Relational Design Chapter 12.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Normalization and FUNctional Dependencies. Redundancy: root of several problems with relational schemas: –redundant storage, insert/delete/update anomalies.
Normal Forms Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems June 18, 2016 Some slide content courtesy of Susan Davidson.
CS 405G: Introduction to Database Systems 13b Exercise Chen Qian University of Kentucky.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
1 CS122A: Introduction to Data Management Lecture #12: Relational DB Design Theory (1) Instructor: Chen Li.
4NF & MULTIVALUED DEPENDENCY By Kristina Miguel. Review  Superkey – a set of attributes which will uniquely identify each tuple in a relation  Candidate.
CS422 Principles of Database Systems Normalization
CS422 Principles of Database Systems Normalization
CS405G: Introduction to Database Systems
Functional Dependencies and Normalization
Functional Dependencies and Normalization
CS 405G: Introduction to Database Systems
Relational Database Design
Presentation transcript:

CS 405G: Introduction to Database Systems 26 Final exam review Chen Qian University of Kentucky

Chen Qian @ University of Kentucky Final exam Tuesday 05/05/14 10:30 – 12:00 This classroom. 4/25/2017 Chen Qian @ University of Kentucky

Read the mid-term review ER diagram Relational Algebra SQL (important!) 4/25/2017 Chen Qian @ Univ of Kentucky

Functional dependencies A functional dependency (FD) has the form X -> Y, where X and Y are sets of attributes in a relation R X -> Y means that whenever two tuples in R agree on all the attributes in X, they must also agree on all attributes in Y 4/25/2017 Chen Qian @ Univ of Kentucky

Chen Qian @ University of Kentucky FD examples Address (street_address, city, state, zip) street_address, city, state -> zip zip -> city, state zip, state -> zip? This is a trivial FD Trivial FD: LHS RHS zip -> state, zip? This is non-trivial, but not completely non-trivial Completely non-trivial FD: LHS ∩ RHS = ? 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ Univ of Kentucky Attribute closure Given R, a set of FD’s F that hold in R, and a set of attributes Z in R: The closure of Z (denoted Z+) with respect to F is the set of all attributes {A1, A2, …} functionally determined by Z (that is, Z -> A1 A2 …) Algorithm for computing the closure Start with closure = Z If X -> Y is in F and X is already in the closure, then also add Y to the closure Repeat until no more attributes can be added 4/25/2017 Chen Qian @ Univ of Kentucky

Using attribute closure Given a relation R and set of FD’s F Does another FD X -> Y follow from F? Compute X+ with respect to F If Y X+, then X -> Y follow from F Is K a super key of R? Compute K+ with respect to F If K+ contains all the attributes of R, K is a super key Is a super key K a key of R? Test where K’ = K – { a | a K} is a superkey of R for all possible a 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Rules of FD’s Armstrong’s axioms Reflexivity: If Y X, then X -> Y Augmentation: If X -> Y, then (X,Z) -> (Y,Z) for any Z Transitivity: If X -> Y and Y -> Z, then X -> Z Rules derived from axioms Splitting: If X -> YZ, then X -> Y and X -> Z Combining: If X -> Y and X -> Z, then X -> YZ 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky First Normal Form ( 1NF ) A relation is in first normal form if the domain of each attribute contains only atomic values, and the value of each attribute contains only a single value from that domain. 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky 2nd Normal Form An attribute A of a relation R is a nonprimary attribute if it is not part of any key in R, otherwise, A is a primary attribute. R is in (general) 2nd normal form if every nonprimary attribute A in R is not partially functionally dependent on any key of R How to identify 2NF How to decompose relations 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Third normal form 3NF requires that there are no non-trivial functional dependencies of non-key attributes on something other than a superset of a candidate key. Recall: non-trivial FD means LHS has no intersection with RHS. In summary, all non-key attributes are mutually independent. 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky BC normal form A table is said to be in the BCNF if and only if it is in the 3NF and every non-trivial, left-irreducible functional dependency has a candidate key as its determinant. How to find violations How to decompose relations 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Conflicts precedence graph conflict-serializable schedule 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Lock exclusive lock and shared locks Two-phase locking All lock requests precede all unlock requests Strict 2PL Only release locks at commit/abort time Examples 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Disk Disk structure Cylinder, platter, track, etc. Random disk access Seek time + rotational delay + transfer time 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky File Storage Heap file as a list or page directory Record format Page layout 4/25/2017 Chen Qian @ University of Kentucky

Tree-Structured Indexes: Introduction Tree-structured indexing techniques support both range selections and equality selections. ISAM =Indexed Sequential Access Method static structure; early index technology. B+ tree: dynamic, adjusts gracefully under inserts and deletes. Operations: search, range query, insert, delete (important!) Understand the examples in the exercise slides! 4/25/2017 Chen Qian @ University of Kentucky 2

Chen Qian @ University of Kentucky Hashing Static hashing Dynamic hashing Extensible and linear hashing Understand examples in slides 4/25/2017 Chen Qian @ University of Kentucky 3

Chen Qian @ University of Kentucky Final Exam 1. True/False 2. Functional Dependency and Normal Forms 3. SQL 4. Index (B+ Tree) 5. Index (B+ Tree) 6. Storage 4/25/2017 Chen Qian @ University of Kentucky

Chen Qian @ University of Kentucky Good luck and hope you enjoy this class! Don’t forget: You give me a grade 4/25/2017 Chen Qian @ University of Kentucky