Class 04. Flashcards
relational models
what are relational model terminology?
- row = tuple/entity
- column = attribute
- table = relation
what are table requirements?
- attributes have unique names
- attribute values are the same
- each cell contains single value
- non-duplicate rows
what do null values indicate?
missing information
what is a schema?
describes the content/relationship/structure of data
what does the schema include in a relational model?
- table name
- column name
- data type
how to convert an ERD to a model with the same attributes?
- underline primary keys
- composite attributes in separate columns
- multivariate attributes in separate tables
what is a relationship set?
- attributes are the primary keys
- attributes that apply to the relationship itself
how to convert many-to-one relationship sets?
- eliminate separate relation for the relationship
- capture the relationship on the “many” side
- “null” entity values that don’t participate in the relationship
how to convert one-to-one relationship sets?
- choose which side to capture the relationship on
how to convert many-to-many relationship sets?
- separate relations whose attributes are primary keys of participating entity sets
- and attributes that apply to the relationship itself
what is the primary key in many-to-many relationships?
the union of the primary keys of the entity
T/F: you separate the relation for many-to-one + one-to-one relationship sets
false
what is a foreign key?
an attribute in one relation that takes value from the primary key attributes of another relation
what is the best way to represent subclasses as relations?
using a foreign key to the superclass
how do you map higher order relationships?
create separate relation with attributes taken from the union of primary keys