Chapter 3 Flashcards
Difference between a primary key and a candidate key?
Candidate key: (a minimal superkey) If a composite key can not be reduced any further and still be unique.
Primary Key: (a specially designated candidate key) The primary key of a table cannot contain null values. Each table contains one primary key.
Difference between a candidate key and a superkey?
Superkey: a column or combination of columns containing unique values for each row. The combination of every column in a table is always a superkey because rows in a table must be unique.
Candidate key: (a minimal superkey) A superkey is minimal if removing any column makes it no longer unique. A single column super key is minimal because no columns can be removed.
What is a null value?
A special value that represents the absence of an actual value. A null value can mean that the actual value is unknown or does not apply to a specified row.
What is the motivation for the entity integrity rule?
No two rows of a table can contain the same value for the primary key. In addition, no row can contain a null value for any column of a primary key.
What is the motivation for the referential integrity rule?
Only two kinds of values can be stored in a foreign key:
A value matching a candidate key value is some row of the table containing the associated candidate key or
A null value.
Relationship between the referential integrity rule and foreign keys?
Foreign keys keys uphold referential integrity between tables.
How are candidate keys that are not primary keys indicated in the CREATE TABLE statement?
CREATE TABLE Table1
(Column1, dataType(XX),
Column2, dataType(XX) )
What is the advantage of using constraint names when defining primary key, candidate key, and referential integrity constraints in CREATE TABLE statements?
Constraint names facilitate identification of the constraint if a violation occurs when a row is inserted or updated.
When is it not permissible for foreign keys to store null values?
When the column value is required.
What is the purpose of a database diagram such as the Access Relationship window?
Lets you define a relationships between items stored in multiple access tables
How is 1-M relationship represented in the Relational Model?
1-M Relationship: A connection between two tables in which one row of a parent table can be referenced by many rows of a child table. 1-M relationships are the most common kind of relationship.
A line from the parent (“1 table) to the foreign key table (“Many table”) represents a 1-M relationship in the Relational Model.
What about M-N relationship? (How is it represented in a relational model?)
M-N Relationship: A connection between two tables in which rows of one table can be related to many rows of the other table. M-N relationships cannot be directly represented in the Relational Model. Two 1-M relationships and a linking or associative table represent a M-N relationship.
Many-to-many relationships are not directly represented in the Relational Model. They are represented by a pair of 1-M relationships and an associative table.
What is a self-referencing relationship?
A relationship in which a foreign key refers to the same table. Self-referencing relationships represent associations among members of the same set.
How is a self-referencing relationship represented in the Relational Model?
There will be a column that represents the self-referencing relationship. (Example: Faculty Members Supervising other Faculty Members: FacSupervisor column). The FacSupervisor column in a row for “the supervised” will contain the PK value of another row that represents the Supervisor in the same table.
What is a referenced row?
A row is referenced if there are rows in a child table with foreign key values identical to the primary key value of the parent table row.