W2 L2 - Relational Databases

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/3

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

4 Terms

1
New cards

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

<p>Block of code which describes a relation</p><p>You must define the PK and FK of each relation</p><p>Also define the ON DELETE and whether an attribute is UNIQUE</p>
2
New cards

Foreign Keys

Involves important PK from one attribute to another, or creating a new table with PKs of tables in relation

<p>Involves important PK from one attribute to another, or creating a new table with PKs of tables in relation</p>
3
New cards

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

4
New cards

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