Test 2 Study Guide Flashcards
Define “relation”.
A relation is a named, two-dimensional table of data.
What are the requirements for a table to qualify as a relation?
It must have a unique name.
Every attribute value must be atomic (not multivalued).
Every row must be unique.
Attribute columns must have unique names.
The order of the rows and columns must be irrelevant.
What do relations correspond to in the E-R model?
Relations correspond with entity types and with M:N relationship types.
What do rows correspond to in the E-R model?
Rows correspond with entity instances and with M:N relationship instances.
What do columns correspond to in the E-R model?
Columns correspond with attributes.
How are primary keys notated in a relational schema?
Primary keys are underlined with a solid line.
How are foreign keys notated in a relational schema?
Foreign keys are underlines with a dotted line.
Define “domain constraint”.
A domain constraint is a way to limit what data values can be placed in an attribute (such as integers, max digits, etc).
Define “entity integrity”.
Entity integrity is when no primary key attributes are allowed to be null, and all primary key fields have data.
Define “referential integrity constraint”.
Referential integrity constraint is where any foreign key value (on the “many” side) must match a primary key value on in the relation of the “1” side.
When converting from an ERD to a relational schema, what happens to composite attributes?
Composite attributes are split into their individual component attributes.
When converting from an ERD to a relational schema, what happens to multivalued attributes?
Multivalued attributes are split off into their own relation with a foreign key relating back to the superior entity.
When converting from an ERD to a relational schema, what happens to weak entities?
Weak entities are broken off into a separate relation, with a foreign key taken from the strong entity. The primary key of this relation is a partial identifier of the weak entity, and the primary key of the strong entity.
When converting from an ERD to a relational schema, what happens to a 1:M relationship?
The primary key on the 1 side of the relationship becomes a foreign key on the many side.
When converting from an ERD to a relational schema, what happens to a M:N relationship?
A new relation is created with a primary key made of the primary keys of each side. These do not act as foreign keys.