EER to Relational Model Flashcards
Tuple
One row of a relation
Attribute
One column of a relation
Relation
An entire table of related attributes
Domain of an Attribute
All the possible values an attribute is allowed to have
Table is a:
Relation
Column Header is a:
Attribute
All possible column values are:
Domain
Row is a:
tuple
Table Definition:
Schema of a relation
Populated table:
State of the relation
SuperKey of R
A subset of the relation attributes where all the tuple values must be distinct
A key is a:
minimal superkey
Candidate Keys
Unique keys that could have been chosen to be the primary key
Primary Key
An arbitrarily chosen candidate key (requires uniqueness)
ER to Relational Schema:
- Map regular entities
Separate attributes - Map weak entities
Weak entities get foreign key of their parent entity - Map M:1 Relationships
the M side gets the foreign key - Map 1:1 Relationships
both sides get the foreign key, ore could merge the
table, or could have an intermediate table - Map M:N relationships
create a new table with the foreign keys - Map multi valued attributes
Create a new table
Foreign Key
Same domain as the primary key that it maps from, but could have different names
Referential Integrity
Controlled through semantics. If you delete a primary key that is a foreign key elsewhere, you have to fix that
Illegal States: Delete
Restricted: Delete is restricted from happening
Cascades: Removes offending entry
Nullifies: FK is set to null
Illegal States: Update
Restricted: Update is restricted
Cascade: Change the values for all offending entries