1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.

Slides:



Advertisements
Similar presentations
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Advertisements

Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
The Relational Model System Development Life Cycle Normalisation
Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. 1.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Methodology Logical Database Design for the Relational Model
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
1 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design.
CS 3630 Database Design and Implementation. First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema DBDL 2.
1 CS 3630 Database Design and Implementation. 2 Final Exam 7:00 – 8:52 PM, Thursday, May 16 Section 1: Ull 009 Section 2: Ull Points –50 points.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Entity-Relationship modeling Transparencies
Lecture 12 Inst: Haya Sammaneh
1 Test1 N = {n: n is an integer and n  0} X = {x: x = n + 5, where n  N} Y = {y: y = 7 * n - 1, where n  N} List the three smallest elements of each.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
CMPE 226 Database Systems September 16 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Normalization. Learners Support Publications 2 Objectives u The purpose of normalization. u The problems associated with redundant data.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Database Design (Normalizations) DCO11310 Database Systems and Design By Rose Chang.
Project – Phase II Derive Database Schema from E-R Model DBDL.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
Team Dosen UMN Database Design Connolly Book Chapter
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
Logical Database Design (1 of 3) John Ortiz Lecture 6Logical Database Design (1)2 Introduction  The logical design is a process of refining DB schema.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
2141-W2013 Mid-term Prep. Next week Monday, Feb 18 – Midterm Covers everything before normalization Wednesday, Feb 20 – Ass 3 (normalization) due – Wrap.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Lecture 5 Normalization. Objectives The purpose of normalization. How normalization can be used when designing a relational database. The potential problems.
Chapter 10 Normalization Pearson Education © 2009.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
In this session, you will learn to: Map an ER diagram to a table Objectives.
CS 3630 Database Design and Implementation. 2 Functions y = f(x) x1 = x2  f(x1) = f(x2) Same x value, then same function value. Yes, it’s a function!
Databases Illuminated Chapter 3 The Entity Relationship Model.
CS 3630 Database Design and Implementation. 2 Design Methodology Three main phases 1.Conceptual database design Understanding client data E-R (EER) Model.
CS 3630 Database Design and Implementation. Unnormalized Form (UNF) student courses John CS363 CS334 CS323 Multi-Value attribute Common in reports 2.
Dr. Mohamed Osman Hegaz1 Logical data base design (2) Normalization.
9/23/2012ISC329 Isabelle Bichindaritz1 Normalization.
Chapter 15 & 16 Conceptual and Logical Database Design Methodology Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.
Logical Database Design and the Relational Model.
11/10/2009GAK1 Normalization. 11/10/2009GAK2 Learning Objectives Definition of normalization and its purpose in database design Types of normal forms.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Lecture 4: Logical Database Design and the Relational Model 1.
Normalization. Overview Earliest  formalized database design technique and at one time was the starting point for logical database design. Today  is.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Chapter 8 Relational Database Design Topic 1: Normalization Chuan Li 1 © Pearson Education Limited 1995, 2005.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
SEEM3430: Information Systems Analysis and Design
CS 3630 Database Design and Implementation
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.
CS 3630 Database Design and Implementation
Assignment 4 Map entities with relationships to relational schemas.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
DBMS ER-Relational Mapping
Presentation transcript:

1 CS 3630 Database Design and Implementation

2 Sets Foundation of relational database. Basic Operations Power set Mapping

3 Relational Algebra Operations Selection Projection (Union) (Set difference) (Intersection) Cartesian product Join Natural Join Outer Join

4 Relational Algebra Operations Apply to relation/table instances The result is still a relation/table instance Syntax

5 Relational Algebra Operations Which tables? Which operations? Which common attribute for join? Which attributes to retrieve?

6 (Guest Booking Hotel)  Guest.*  (fromDate = CurrentDate and hotelName = ‘Grosvenor’)

7 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design. Three main phases 1.Conceptual database design E-R Model 2.Logical database design Mapping E-R Model to (relational) database schema Normalization 3.Physical database design

8 E-R Model Entity Attributes: Simple or Composite Single-value or Multi-value Required or optional Relationship One-to-One One-to-Many Many-to-Many Could have attributes

9 Multiplicity For one object on the other side! E1 (1..1) IsRelatedTo (0..1) E2 E1 (0..*) IsRelatedTo (1..1) E2 E1 (0..*) IsRelatedTo (1..*) E2 Staff (1..*) IsRelatedTo (0..1) Branch Renter (0..*) Views (0..*) Property Date, Comment

10 Mapping Entity Composite Attribute Do we need a new table? NO! Multi-value Attribute Do we need a new table? YES!

11 Mapping Relationships One-to-Many Do we need a new table? NO! One-to-One Do we need a new table? NO! Many-to-Many Do we need a new table? YES!

12 Table Table Schema Definition DBDL Do not change too often Table Instance Records stored in database Different at different times Candidate keys

13 Candidate Key A minimum set of attributes that uniquely identifies each record of a table. No proper subset satisfying the definition. R (Att1, Att2, Att3) Candidate Keys: (Att1, Att2) Either Att1 or Att2 is not a candidate key But Att3 could be a candidate key

14 Candidate Key A minimum set of attributes that uniquely identifies each record of a table. No proper subset satisfying the definition. R (Att1, Att2, Att3, Att4) Candidate Keys: (Att1, Att2) Att3 Functional Dependency Att3  All other attributes Att1, Att2  All other attributes Att1  All other attributes Not True Att2  All other attributes Not True

15 Candidate Key, PK, AK and FK A table could have more than one candidate key. One candidate key is selected as the primary key (PK). Other candidate keys become alternate keys (AK). PK can be copied to other tables as foreign keys (FK).

16 Functional Dependency Definition In a relation/table R S: a set of attributes T: a set of attributes S  T For ANY relation instance If two records of R have the same values on S Then they will have the same values on T Trivial FDs A  A A, B, C  B, C

First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema 17

Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF. No Partial FD on PK. 18

Third Normal Form (3NF) Relation R in 2NF, and No non-Primary-Key attribute is transitively functionally dependent on the primary key Then R is in 3NF. No Transitive FD on PK. Must be in 2NF! 19

Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. Stronger than 3NF! 20

Test 1: 50 Points Wednesday Lab 206 Sets Relational Database Model Relational Algebra Mapping E-R model to table schema Functional Dependency Normalization Open Book, Notes, Computer Copy-paste word document 21

Quiz2 22

Assignment6-2 23

Schedule Wednesday Test1 Friday Assignment7 (Due 5 pm Friday) 24