Functional Dependencies

Slides:



Advertisements
Similar presentations
Exercise 1 Consider the ER diagram below. Assume that an employee may work in up to two departments or may not be assigned to any department. Assume that.
Advertisements

Information Systems Chapter 4 Relational Databases Modelling.
Functional Dependencies Definition: If two tuples agree on the attributes A, A, … A 12n then they must also agree on the attributes B, B, … B 12m Formally:
Lecture #3 Functional Dependencies Normalization Relational Algebra Thursday, October 12, 2000.
1 Lecture 3: Database Modeling (continued) April 5, 2002.
Lecture 9: Conceptual Database Design January 27 th, 2003.
Multiplicity in E/R Diagrams
Functional Dependencies and Relational Schema Design.
The Relational Data Model Database Model (ODL, E/R) Relational Schema Physical storage ODL definitions Diagrams (E/R) Tables: row names: attributes rows:
1 Lecture 4: Database Modeling (end) The Relational Data Model April 8, 2002.
COURSE REGISTRATION SYSTEM Case study IST2101. Case Study: Course Registration (1) IST2102 You are helping Penn State create a course registration system.
Database Design April 3, Projects, More Details Goal: build a DB application. (almost) anything goes. Groups of 3-4. End of week 2: groups formed.
Entity / Relationship Diagrams Objects entities Classes entity sets Attributes are like in ODL. Relationships: like in ODL except - not associated with.
E/R Diagrams and Functional Dependencies. Modeling Subclasses The world is inherently hierarchical. Some entities are special cases of others We need.
Lecture 08: E/R Diagrams and Functional Dependencies.
Lecture 2: E/R Diagrams and the Relational Model Thursday, January 4, 2001.
Conceptual Database Design. Building an Application with a DBMS Requirements modeling (conceptual, pictures) –Decide what entities should be part of the.
1 Introduction to Database Systems CSE 444 Lecture 07 E/R Diagrams October 10, 2007.
Normalization Exercise. First Normal Form Second Normal Form.
COMP 430 Intro. to Database Systems Entity-Relationship Diagram Basics Slides use ideas from Chris Ré.
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
CS411 Database Systems Kazuhiro Minami 04: Relational Schema Design.
Formal definition of a key A key is a set of attributes A 1,..., A n such that for any other attribute B: A 1,..., A n  B A minimal key is a set of attributes.
Data Base Design Steps 1.Define Entity Classes (Relations/Tables) and Keys. 2.Define Relationships between Entity Classes. Normalization Steps Eliminate.
ER Diagrams and Relational Model CS 174a (Winter 2015)
The Relational Data Model Database Model (ODL, E/R) Relational Schema Physical storage ODL definitions Diagrams (E/R) Tables: row names: attributes rows:
Entity-Relationship Data Model
COP Introduction to Database Structures
Lecture 11: Functional Dependencies
Assignements.
Lecture 5: Conceptual Database Design
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
COP5725 Database Management ER DIAGRAM AND RELATIONAL DATA MODEL
COP4710 Database Systems E-R Model.
Database Design Oct. 3, 2001.
Database Design Why do we need it? Consider issues such as:
Relational Algebra at a Glance
ER Diagram Practical Example
Lecture 4 Lecture 4: The E/R Model.
Conceptual Database Design
Modeling Your Data Chapter 2 cs542
Order Database – ER Diagram
From E/R Diagrams to Relational Schema
Lecture 4: Database Modeling (continued)
Entity Relationship Diagrams
Cse 344 May 11th – Entities.
Entity – Relationship Model
Lecture 2: Database Modeling (end) The Relational Data Model
Lecture 06 Data Modeling: E/R Diagrams
Functional Dependencies and Relational Schema Design
Logic Modeling Logic and timing are not represented on data flow diagrams or entity-relationship diagrams Processes contain logic - what happens under.
Lecture 09: Functional Dependencies, Database Design
name category name price makes Company Product stockprice buys employs
The Entity-Relationship Model
CMPT 354: Database System I
Lecture 8: Database Design
Lecture 8: The E/R Model I
Lecture 9: The E/R Model II
Functional Dependencies
Lecture 5: The Relational Data Model
CSE544 Data Modeling, Conceptual Design
Functional Dependencies
Lecture 06: SQL Monday, October 11, 2004.
CS4433 Database Systems E-R Model.
Terminology Product Attribute names Name Price Category Manufacturer
Lecture 08: E/R Diagrams and Functional Dependencies
Entity-Relationship Data Model
Lecture 6: Functional Dependencies
Chapter 3 The Relational Model
Presentation transcript:

Functional Dependencies Definition: If two tuples agree on the attributes A , A , … A 1 2 n then they must also agree on the attributes B , B , … B 1 2 m Formally: A , A , … A B , B , … B 1 2 n 1 2 m Motivating example for the study of functional dependencies: Name Social Security Number Phone Number

Examples Product: name price, manufacturer Person: ssn name, age Company: name stock price, president Key of a relation is a set of attributes that: - functionally determines all the attributes of the relation - none of its subsets determines all the attributes. Superkey: a set of attributes that contains a key.

Finding the Attributes of a Relation Given a relation constructed from an E/R diagram, what is its key? Rules: 1. If the relation comes from an entity set, the key of the relation is the set of attributes which is the key of the entity set. Person name ssn address

Rules for Binary Relationships name buys Person Product price name ssn Several cases are possible for a binary relationship E1 - E2: 1. Many-many: the key includes the key of E1 together with the key of E2. What happens for: 2. Many-one: 3. One-one:

Rules for Multiway Relationships None, really. Except: if there is an arrow from the relationship to E, then we don’t need the key of E as part of the relation key. Product Purchase Store Payment Method Person