Mod4-Relational Database Flashcards
(29 cards)
Tables (relations), rows, columns
data structure
◦ Mechanisms for implementing business rules that
maintain integrity of manipulated data
data integrity
Powerful SQL operations for retrieving and modifying data
data manipulation
is a named, two-dimensional table of data.
relation
consists of rows (records) and columns (attribute or field).
table/relation
➢ Every attribute value must be atomic (not multivalued, not composite).
true
➢ Every row must be unique (can’t have two rows with exactly the same values
for all their fields).
true
➢ Attributes (columns) in tables must have unique names.
➢ The order of the columns must be irrelevant.
➢ The order of the rows must be irrelevant.
true
correspond with entity types and with many-to-many
relationship types.
relation(tables)
correspond with entity instances and with many-to-many relationship
instances.
rows
correspond with attributes.
columns
The word relation (in relational database) is NOT the same as the
word relationship(in E-R model).
true
are unique identifiers of the relation. Examples include employee
numbers, social security numbers, etc. This guarantees that all rows are unique.
primary keys
are identifiers that enable a dependent relation (on the many side of a
relationship) to refer to its parent relation (on the one side of the relationship).
foreign keys
can be simple (a single field) or composite
(more than one field).
keys
usually are used as indexes to speed up the
response to user queries.
keys
domain constraints
entity integrity
integrity constraints
▪ Allowable values for an attribute
domain contraints
No primary key attribute may be null. All primary key fields MUST have data.
entity integrity
rule states that any foreign key value (on the relation of the many
side) MUST match a primary key value in the relation of the one side. (Or the foreign
key can be null)
are drawn via arrow from dependent to parent table
are implemented with foreign key to primary key references
referential integrity
: E-R attributes map
directly onto the relation
Mapping Regular Entities to Relations
simple attributes
Use only their
simple, component attributes
Mapping Regular Entities to Relations
composite attributes
Becomes a separate
relation with a foreign key taken from the
superior entity
Mapping Regular Entities to Relations
multivalued attributes
▪Becomes a separate relation with a foreign
key taken from the superior entity
▪Primary key composed of:
✓Partial identifier of weak entity
✓Primary key of identifying relation (strong
entity)
mapping weak entities