Logical Database using ER Flashcards
Relation Model ?
Collections of relations (Tables)
Each Relations consists of what ?
Set of tuples (records/rows) &
Set of attributes (columns)
Each Relation is described using ?
Schema &
Instance
Describe Relation Schema
Specifies structure of the relation -
Name
Attribute
Type(Domain)
Constraints
Describe Relation Instance
It is a TUPLE, basically a ROW form the entire relation/table.
Degree (arity) of a Relation
Total number of ATTRIBUTES/COLUMNS
Cardinality of a Relation
Total number of TUPLES/ROW
Integrity Constraints
Condition specified on database schema.
Restriction on a tuple
Types of Integrity Constraints
5 types -
1. Primary key
2. Unique
3. Not Null
4. Foreign Key
5. Check
Super Key
Set of those keys that identify a row or a tuple uniquely
Super set of candidate key
Usually two tuples
Candidate Key
Attribute or set of attribute
Identify each record uniquely
{ID} and {Name, DOB}.
Primary Key
Identify each record uniquely
Can be only one attribute
Can be one per relation
Foreign Key
What does foreign key links
two tables/relations
Table with foreign key
Referencing Table
Child Table