Constraints and Functional Dependencies




CS157a

Chris Pollett

Sep 16, 2019

Outline

Introduction

Constraints on Relations

Relational Algebra as a Constraint Language

Referential Integrity Constraints

Key Constraints

Other Kinds of Constraints

Quiz

Which of the following is true?

  1. The only way to store dates in SQL is using the INT type.
  2. Keys in SQL can be declared using either the UNIQUE or PRIMARY KEY keywords.
  3. A Natural Join of two relations `R` and `S` will always have size proportional to `O(|R| + |S|)`.

Database Design Theory

Definition of a Function Dependency

Keys of a Relation

Reasoning About Functional Dependencies

Splitting Combining Rule

Trivial Functional Dependencies