Exam Two Flashcards
data are organized in the form of tables/relations, rows, columns
data structure
powerful SQL operations for retrieving and modifying data stored in the relation
data manipulation
mechanisms for implementing business rules that maintain integrity of manipulated data
data integrity
named, 2D table of data, rows (records), columns (fields)
relation
to qualify a table as a relation what six things must it have?
unique table name
every attribute value must be atomic (not multivalued or composite)
every row must be unique
attributes/columns must have unique names
order of columns must be irrelevant
order of rows must be irrelevant
used as indexes to speed up response to user queries
key fields
unique identifiers of relations, guarantees all rows are unique
primary keys
identifiers that enable a dependent relation (on many side of relationship) to refer to its parent relation (on the one side)
foreign keys
first step of relational model
mapping regular entities to relations
what to do with composite attributes in relational model?
use only in their simple component attribute form
what to do with multivalued attributes in relational model?
become separate relation with foreign key taken from the superior entity
second step of relational model
mapping weak entities
what to do with weak entities in relational model?
becomes separate relation with foreign key taken from the superior entity
what is the primary key composed of for a weak entity?
partial identifier of weak entity and primary key of identifying relation
third step of relational model
mapping binary relationships
what to do with a one to many relationship in relational model?
primary key on one side becomes foreign key on the many side
what to do with a many to many relationship in relational model?
create a new relation with the primary keys of the two entities as its primary key, composite primary key
what to do with a one or one relationship in relational model?
primary key on mandatory side becomes foreign key on optional side
fourth step of relational model
mapping associative entities
what to do with associative entity if identifier is not assigned in relational model?
default primary key is composed of primary keys of two entities
what to do with associative entity if identifier is assigned in relational model?
make primary keys into foreign keys
fifth step of relational model
mapping unary relationships
what to do with unary relationships that are one to many in relational model?
recursive foreign key in the same relation, make new field and make it the foreign key
what to do with unary relationships that are many to many in relational model?
make two relations, one for associative relation where primary key has two attributes both from primary key
sixth step of relational model
mapping ternary relationships
what to do for ternary relationships in relational model?
one relation for each entity and one for associative, associative entity relation has foreign keys to each entity in the relationship
seventh step of relational model
mapping supertype/subtype relationship
what to do for supertype/subtype relationship in relational model?
one relation for supertype and one for each subtype, primary key of supertype becomes primary key of subtype discrimination with a different name
how to treat partial and overlapping for supertype/subtype relationship in relational model?
partial- can be unknown
overlapping- treat as composite attribute and take them seperately
allowable values for an attribute (includes data types and restrictions on values), all of the values that appear in a column of a relation must be from the same domain
domain constraints
no primary key attributes may be null, all primary key values must contain data values that must be unique, no two rows the same
entity integrity
rules that maintain consistency between the rows of two related tables, foreign key value on many side must match a primary key values on one side
referential integrity
what are the three parts of referential integrity?
restrict, cascade, set-to-null