Free Online Flashcard Deck

2 Keys and Relationships Free Online FlashCards

Study 2 Keys and Relationships with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What is a candidate key?

Back

A candidate key is a minimal set of one or more columns that uniquely identifies every row.

02
Front

What is a table’s primary key?

Back

A primary key is the candidate key selected as the table’s main identifier. It must be unique and non-null, and a table can have at most one.

03
Front

What is a composite key?

Back

A composite key uses multiple columns together as a key.

04
Front

How can a table enforce a candidate key that is not its primary key?

Back

Other candidate keys can be enforced with UNIQUE constraints.

05
Front

What key can a foreign key refer to?

Back

A foreign key refers to a primary key or another unique key in a different table.

06
Front

What does referential integrity require?

Back

Referential integrity requires each non-null foreign-key value to match an existing value in the referenced key.

07
Front

What must match between foreign-key columns and referenced columns?

Back

The referencing and referenced columns must have the same number of columns and compatible data types.

08
Front

How does foreign-key nullability represent an optional relationship?

Back

A nullable foreign key allows an optional relationship. Add NOT NULL when every row must be linked.

09
Front

How does a foreign key represent a one-to-many relationship?

Back

In a one-to-many relationship, one parent can be linked to many child rows, while each child points to one parent.

10
Front

How can a foreign key enforce a one-to-one relationship?

Back

Make the foreign key UNIQUE so that no two rows can refer to the same parent.

11
Front

How is a many-to-many relationship usually represented?

Back

A many-to-many relationship is usually represented by a junction table with foreign keys to both related tables.

12
Front

How can an enrollment table prevent duplicate student-course pairs?

Back

A composite primary key on the two foreign keys can prevent duplicate pairs, so the same student-course enrollment cannot be entered twice.