Assignment 5-1 Functional Dependencies Attributes within one table True for all table instances Part of table schema (Assumptions) Cannot get FDs just.

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

CS 3630 Database Design and Implementation. Where Clause and Aggregate Functions -- List all rooms whose price is greater than the -- average room price.
ER Modeling Case Studies
ER Modeling Case Studies
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
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.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Normalization.
Assignment 6-1 Schedule(staffNo, dentistName, patNo, patName, surgeryNo, Date, Time) Make assumptions: surgeryNo is the surgery room number. staffNo, patNo,
Ms. Hatoon Al-Sagri CCIS – IS Department Normalization.
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. 1.
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.
ER Modeling Case Studies
CS 405G: Introduction to Database Systems 16. Functional Dependency.
CREATE THE DIFFERENCE Normalisation (special thanks to Janet Francis for this presentation)
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.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
Project – Phase II Derive Database Schema from E-R Model DBDL.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 10 Functional Dependencies and Normalization for Relational Databases.
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.
Creating Tables and Inserting Records -- Not easy to edit! -- check constraints! Create table test1 ( C1 char(5) primary key, C2 Varchar2(15) not null.
1 Functional Dependencies and Normalization Chapter 15.
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!
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Deanship of Distance Learning Avicenna Center for E-Learning 1 Session - 7 Sequence - 2 Normalization Functional Dependencies Presented by: Dr. Samir Tartir.
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.
Lecture9:Functional Dependencies and Normalization for Relational Databases Ref. Chapter Lecture9 1.
Chapter 7 Normalization Chapter 14 & 15 in Textbook.
Database Design – Lecture 6 Moving to a Logical Model.
Enhanced Entity-Relationship Modeling
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
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.
Ch 7: Normalization-Part 1
Assignment 5–2 For each new relation, Use DBDL to specify the relation scheme Give the functional dependencies Give the corresponding relation instance.
Patient Identification at DUH “ALWAYS the Right Patient” We put the person who needs our care at the center of everything we do Requirements for Staff.
Functional Dependencies and Normalization for Relational Databases 1 Chapter 15 تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في.
Multiplication Timed Tests.
Let try to identify the conectivity of these entity relationship
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Multiplication table. x
CS 3630 Database Design and Implementation
Assignment 4 Map entities with relationships to relational schemas.
ER Modeling Case Studies
CS 3630 Database Design and Implementation
Assignment 5–2 For each table, Give a meaningful name
CS 3630 Database Design and Implementation
Multiplication Tables
CS 3630 Database Design and Implementation
Boyce-Codd Normal Form (BCNF)
CS 3630 Database Design and Implementation
Normalization.
5 × 7 = × 7 = 70 9 × 7 = CONNECTIONS IN 7 × TABLE
5 × 8 = 40 4 × 8 = 32 9 × 8 = CONNECTIONS IN 8 × TABLE
ER Modeling Case Studies
5 × 6 = 30 2 × 6 = 12 7 × 6 = CONNECTIONS IN 6 × TABLE
Database Normalisation
DATABASE DESIGN & DEVELOPMENT
Weak Entities (cont…) Entities that do not have key attributes of their own Related to specific entities from another entity type plus their own attributes.
Presentation transcript:

Assignment 5-1 Functional Dependencies Attributes within one table True for all table instances Part of table schema (Assumptions) Cannot get FDs just from one table instance Not normalization yet

Assumptions NIN, hNo, and ContractNo are unique for Staff, Hotel, and Contract, respectively. hLoc is the city where a hotel is located. Several hotels may be in the same city. One hotel could have several contracts. One contract is for one hotel. Several staff may work on one contract. One staff may work on several contracts on the same hotel. hours is the total hours of one staff on one contract. More than one employee could have the same name.

eName  NIN NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1135 C Smith J H4 Glasgow ….. ……... ……… …. …………… C Smith J H25 East Kilbride Incorrect: eName  NIN (More than one employee could have the same name.) Correct: NIN  eName (NIN is unique for Staff)

NIN  All NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1135 C Smith J H4 Glasgow ….. ……... ……… …. …………… C Smith J H25 East Kilbride Incorrect: NIN  All Incorrect: NIN  hours Incorrect: NIN  hNo (One staff may work on several contracts on the same hotel)

NIN, hNo  All NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1135 C Smith J H4 Glasgow ….. ……... ……… …. …………… C Smith J H25 East Kilbride Incorrect: NIN, hNo  All (One staff may work on several contracts on the same hotel) Incorrect: NIN, hLoc  All

ContractNo, hNo  All NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1057 C Hocine D H25 East Kilbride 1068 C White T H4 Glasgow 1135 C Smith J H4 Glasgow ….. ……... ……… …. ……………. Incorrect: ContractNo, hNo  All (Several staff may work on one contract) hNo not needed anyway: ContractNo  All Incorrect: ContractNo, hLoc  All

ContractNo  eName NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1057 C Hocine D H25 East Kilbride 1068 C White T H4 Glasgow 1135 C Smith J H4 Glasgow ….. ……... ……… …. ……………. Incorrect: ContractNo  eName (Several staff may work on one contract) Incorrect: ContractNo  hours

hNo  ContractNo NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1057 C Hocine D H25 East Kilbride 1068 C White T H4 Glasgow 1135 C Smith J H4 Glasgow ….. ……... ……… …. …………… C Smith J H4 Glasgow Incorrect: hNo  ContractNo (One hotel could have several contracts)

hLoc  hNo NIN contractNo hours eName hNo hLoc 1135 C Smith J H25 East Kilbride 1057 C Hocine D H25 East Kilbride 1068 C White T H4 Glasgow 1135 C Smith J H4 Glasgow ….. ……... ……… …. …………… C Smith J H14 Glasgow Incorrect: hLoc  hNo (hLoc is the city where a hotel is located) (Several hotels may be in the same city)

NIN  eName contractNo  hNo hNo  hLoc NIN, contractNo  hours NIN, contractNo  hours, eName, hNo, hLoc NIN, contractNo  All

1.Assumptions 2.Identify all non-trivial FDs NIN  eName contractNo  hNo hNo  hLoc NIN, contractNo  hours ( NIN, contractNo  All) 3.Choose a PK: NIN, contractNo 4.List all AKs: NONE

Assignment 6-1 Schedule(staffNo, dentistName, patNo, patName, surgeryNo, Date, Time) Make assumptions: staffNo, patNo, and surgeryNo are unique. (for what?) SurgeryNo is the surgery room number. Date and Time are two different attributes. No Appointment! A patient is allowed to have more than one surgery a day. Only one surgery can take place in a room at any given time. A dentist can perform only one surgery at any given time. A dentist is allocated in one surgery room each day. But a surgery room can be used by multiple dentists on the same day. Due Monday 12