Assignment 5–2 For each table, Give a meaningful name

Slides:



Advertisements
Similar presentations
1 Quiz 2. 2 One instructor cannot be at two or more class rooms at the same time. One class room cannot be shared by two or more instructors at the same.
Advertisements

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.
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.
Project Phase I Phase II Due Monday, April 15 Groups 1.
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.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 5 Normalization of Database Tables.
1 times table 2 times table 3 times table 4 times table 5 times table
Assignment 5-1 Functional Dependencies Attributes within one table True for all table instances Part of table schema (Assumptions) Cannot get FDs just.
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.
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.
Organizing Data Revision: pages 8-10, 31 Chapter 3.
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.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
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
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
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.
Database Design – Lecture 6 Moving to a Logical Model.
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.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
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.
Tables Learning Support
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Assignment 5–2 For each new relation, Use DBDL to specify the relation scheme Give the functional dependencies Give the corresponding relation instance.
Al-Imam University Girls Education Center Collage of Computer Science 1 st Semester, 1432/1433H Chapter 10_part 1 Functional Dependencies and Normalization.
CS 3630 Database Design and Implementation. Joins Retrieve data from two or more tables Join Conditions PK and FK (Natural Join) Other attributes (Theta.
基 督 再 來 (一). 經文: 1 你們心裡不要憂愁;你們信神,也當信我。 2 在我父的家裡有許多住處;若是沒有,我就早 已告訴你們了。我去原是為你們預備地去 。 3 我 若去為你們預備了地方,就必再來接你們到我那 裡去,我在 那裡,叫你們也在那裡, ] ( 約 14 : 1-3)
CS 3630 Database Design and Implementation
Tables & Relationships
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Database Design The Relational Model Text Ch5
CS 3630 Database Design and Implementation
ASSIGNMENT NO.-2.
Times Tables.
Assignment 4 Map entities with relationships to relational schemas.
Implementation of Entity Relationships
Theory behind the relational engine
Theory behind the relational engine
CS 3630 Database Design and Implementation
Normalization 2NF & 3NF Presented by: Dr. Samir Tartir
CS 3630 Database Design and Implementation
فرایند بازاریابی.
CS 3630 Database Design and Implementation
Boyce-Codd Normal Form (BCNF)
CS 3630 Database Design and Implementation
Слайд-дәріс Қарағанды мемлекеттік техникалық университеті
CS 3630 Database Design and Implementation
.. -"""--..J '. / /I/I =---=-- -, _ --, _ = :;:.
Normalization.
II //II // \ Others Q.
I1I1 a 1·1,.,.,,I.,,I · I 1··n I J,-·
Database Normalisation
Sampath Jayarathna Cal Poly Pomona
3 times tables.
6 times tables.
. '. '. I;.,, - - "!' - -·-·,Ii '.....,,......, -,
Presentation transcript:

Assignment 5–2 For each table, Give a meaningful name Use DBDL to specify the relation scheme Give the functional dependencies Give the corresponding table instance

Assignment 5–2 StaffProjHours (NIN, ContractNo, eName, hours, hNo, hLoc) PK: NIN, ContractNo AK: None FK: None FDs: NIN ===> eName hNo ===> hLoc ContractNo ===> hNo, hLoc NIN, ContractNo ===> eName, hNo, hLoc, hours Not in 2NF How many tables (relations)? Staff: NIN ===> eName Contract: ContractNo ===> hNo, hLoc StaffProjHours : NIN, ContractNo ===> hours

Assignment 5–2 2NF Staff (NIN, eName) PK: NIN AK: NONE FK: NONE FDs: Table (Relation) Instance (Remove duplicate records) NIN eName 1135 Smith J 1057 Hocine D White T 1160 Smith J

Assignment 5–2 2NF Contract (ContractNo, hNo, hLoc) PK: ContractNo AK: NONE FK: NONE FDs: ContractNo ===> hNo, hLoc hNo ===> hLoc Table (Relation) Instance (Remove duplicate records) ContractNo hNo hLoc C1024 H25 East Kilbride C1025 H24 Glasgow C1026 H25 East Kilbride C1027 H29 East Kilbride

Assignment 5–2 2NF StaffProjHours (NIN, ContractNo, hours) PK: ContractNo, NIN AK: NONE FK: NIN References Staff ContractNo References Contract FDs: NIN, ContractNo ===> hours Table (Relation) Instance NIN ContractNo hours 1135 C1024 16 1057 C1024 24 1068 C1025 28 C1026 15 1160 C1027 16

Assignment 5–2 Not in 3NF Contract (ContractNo, hNo, hLoc) PK: ContractNo AK: NONE FK: NONE FDs: ContractNo ===> hNo, hLoc hNo ===> hLoc How many tables? Hotel (hNo, hLoc) Contract (ContractNo, hNo)

Assignment 5 – Part II 3NF Hotel (hNo, hLoc) PK: hNo AK: NONE FK: NONE FDs: hNo ===> hLoc Table (Relation) Instance hNo hLoc H24 Glasgow H25 East Kilbride H29 East Kilbride

Assignment 5 – Part II 3NF Contract (ContractNo, hNo) PK: ContractNo AK: NONE FK: hNo References Hotel FDs: ContractNo ===> hNo Table (Relation) Instance ContractNo hNo C1024 H25 C1025 H24 C1026 H25 C1027 H29

Assignment 5–2 List the names of all tables of your final result. (not relationships!) Staff Hotel Contract StaffProjHours

Style NIN eName 1135 Smith J 1057 Hocine D 1068 White T NIN ContractNo Staff (NIN, eName) PK: NIN AK: None FK: None FD: NIN ===> eName Table Instance StaffProjHours (NIN, ContractNo, hours) PK: NIN, ContractNo AK: None FK: NIN References Staff ContractNo References Contract FD: NIN, ContractNo ===> hours Table Instance NIN eName 1135 Smith J 1057 Hocine D 1068 White T NIN ContractNo hours 1135 C1024 16 1057 24 1068 C1025 28 15

Style Staff (NIN, eName) PK: NIN AK: None FK: None FD: Table Instance NIN eName 1135 Smith J 1057 Hocine D 1068 White T StaffProjHours (NIN, ContractNo, hours) PK: NIN, ContractNo AK: None FK: NIN References Staff ContractNo References Contract FD: NIN, ContractNo ===> hours Table Instance NIN ContractNo hours 1135 C1024 16 1057 C1024 24 1068 C1025 28 1135 C1025 15

Meaningful Table Names Staff (NIN, eName) Patient (NIN, eName) Hotel (hNo, hLoc) Hospital (hNo, hLoc)