Chapter 3 Flashcards

1
Q

Difference between a primary key and a candidate key?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Difference between a candidate key and a superkey?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a null value?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the motivation for the entity integrity rule?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the motivation for the referential integrity rule?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Relationship between the referential integrity rule and foreign keys?

A

Foreign keys keys uphold referential integrity between tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How are candidate keys that are not primary keys indicated in the CREATE TABLE statement?

A

CREATE TABLE Table1
(Column1, dataType(XX),
Column2, dataType(XX) )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the advantage of using constraint names when defining primary key, candidate key, and referential integrity constraints in CREATE TABLE statements?

A

Constraint names facilitate identification of the constraint if a violation occurs when a row is inserted or updated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When is it not permissible for foreign keys to store null values?

A

When the column value is required.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of a database diagram such as the Access Relationship window?

A

Lets you define a relationships between items stored in multiple access tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is 1-M relationship represented in the Relational Model?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What about M-N relationship? (How is it represented in a relational model?)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a self-referencing relationship?

A

A relationship in which a foreign key refers to the same table. Self-referencing relationships represent associations among members of the same set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How is a self-referencing relationship represented in the Relational Model?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a referenced row?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What two actions on referenced rows can affect related rows in a child table?

A

Deleting a referenced row

Updating the primary key of a referenced row

17
Q

What are the possible actions on related rows after a referenced row is deleted or its primary key is updated?

A

Restrict: Do not allow the action on the referenced row.
Cascade: Perform the same action (cascade the action) on related rows.
Nullify: Set the foreign key of relation rows to null.
Default: Set the foreign key of related rows to its default value.

18
Q

Why is the restricted action for referenced rows more common than the cascade action?

A

Because of the possible impact of referential integrity and to prevent loss of data.

19
Q

When is the nullify action not allowed?

A

When the foreign key doesn’t allow null values.

20
Q

Why is the extended cross product operator used sparingly?

A

Extended Cross Product: an operator that builds a table consisting of all combinations of rows from each of the two input tables. (Used sparingly because excessive data is generated)

21
Q

How are grouping columns used in the summarize operator?

A

Groups can be compressed or summarized by a calculated value. (min, max, average, sum)

22
Q

Why is the divide operator not as widely used as the join operator?

A

The matching requirement in divide is more stringent than join and more difficult to understand.
Example
Join: retrieves offerings taken by any student
Divide: retrieves offerings taken by all (or every) students.

23
Q

What are the requirements of union compatibility?

A

Each table must have the same number of columns and each corresponding column must have a compatible data type.

24
Q

Two interpretations for null values?

A

Absence of a value

Value unknown