E/R Design and Constraints




CS157a

Chris Pollett

Oct 16, 2023

Outline

Introduction

Subclasses in the E/R Model

Example isa relationship

Design Principles for E/R Diagrams

Faithfulness

Avoiding Redundancy

Simplicity Counts

Choosing the Right Relationship

Picking the Right Kind of Element

Replacing an Entity Set with Attributes

Quiz

Which of the following is true?

  1. You can have a relation in 4NF that is not in BCNF.
  2. Given a minimal basis F containing a dependency `X->A`, it is possible after running the synthesis algorithm that the output does not have a relation containing the attributes `X \cup {A}`.
  3. E/R digrams use diamonds to indicate relationships.

Constraints in the E/R Model

Keys in the E/R Model

ER Diagram With Keys Indicated

Referential Integrity

ER Diagram With Referential Constraints

Degree Constraints

ER Diagram With Degree Constraints

Weak Entity Sets

Example Weak Entity Set Example Weak Entity Set from Multiway relation

Conditions for a Weak Entity Set to Exist