1/3
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Relational Schema
Block of code which describes a relation
You must define the PK and FK of each relation
Also define the ON DELETE and whether an attribute is UNIQUE
Foreign Keys
Involves important PK from one attribute to another, or creating a new table with PKs of tables in relation
ON DELETE…
Default - Deletion / update rejected
CASCADE - Delete all tuples that refer to delete tuples
SET NULL / DEFAULT - Sets foreign key value of referencing tuple to null / default
Domain vs Key Constraints
Domain:
Type and valid range of value
Eg: Age must be an int between 0-100
Key:
Ensures uniqueness of rows
Eg: Student_ID must be unique