Chapter 3.2 Flashcards
What does an Integrity Constraint (IC) refer to in a database?
A condition that must be true for any instance of the database, such as domain constraints.
ICs are specified when the schema is defined and checked when relations are modified.
What is a legal instance of a relation?
An instance that satisfies all specified Integrity Constraints (ICs).
What is the role of a Database Management System (DBMS) regarding illegal instances?
The DBMS should not allow illegal instances.
What is a primary key?
A set of fields that uniquely identifies a tuple in a relation, ensuring no two distinct tuples can have the same values in all key fields.
What is the difference between a candidate key and a superkey?
A candidate key is a minimal superkey; no subset of the candidate key can uniquely identify a tuple.
Fill in the blank: A set of fields in one relation that refers to a tuple in another relation is called a ______.
[foreign key]
What is referential integrity?
A condition achieved when all foreign key constraints are enforced, preventing dangling references.
What happens if an Enrolled tuple with a non-existent student ID is inserted?
It is rejected.
What is the default action for foreign key constraints on deletes and updates in SQL?
NO ACTION (delete/update is rejected).
What does the CASCADE option do in foreign key constraints?
It deletes all tuples that refer to the deleted tuple.
What is a weak entity?
An entity that can only be identified uniquely by considering the primary key of another (owner) entity.
What is the significance of total participation in a weak entity set?
It means that every weak entity must be associated with an owner entity.
True or False: A weak entity set must have total participation in its identifying relationship set.
True.
What is the purpose of a view in a database?
A view stores a definition rather than a set of tuples, allowing for virtual tables.
What is the primary key in the Enrolled table example?
PRIMARY KEY (sid, cid).