1. Home
  2. Explore
  3. Computer Science
  4. Types of Database Keys

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Types of Database Keys

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Key Fundamentals
The
of a table is a column or combination of columns that uniquely identifies each row and cannot contain null values.

21 questions

  1. 1
    The
    _____
    of a table is a column or combination of columns that uniquely identifies each row and cannot contain null values.
    Hint

    Think about the most fundamental unique identifier for a table.

    Answer

    primary key

  2. 2
    A
    _____
    is any column or combination of columns that could serve as the primary key, meaning it uniquely identifies rows and is irreducible.
    Hint

    These are the 'candidates' to become the primary key.

    Answer

    candidate key

  3. 3
    A
    _____
    is a set of attributes that contains a candidate key plus potentially additional attributes that are not necessary for uniqueness.
    Hint

    Consider a key that is 'super' because it has extra attributes beyond what's needed.

    Answer

    super key

  4. 4
    A candidate key that is not chosen as the primary key is called an
    _____
    .
    Hint

    It's an alternative to the primary key among the candidates.

    Answer

    alternate key

  5. 5
    A key that consists of a single attribute is called a
    _____
    .
    Hint

    This key is not composite.

    Answer

    simple key

  6. 6
    A key that consists of more than one attribute is called a
    _____
    .
    Hint

    This key involves multiple columns.

    Answer

    composite key

  7. 7
    A
    _____
    key is an artificial key added to a table that has no real-world meaning; its values are only meaningful within the database.
    Hint

    Think of a stand-in or substitute.

    Answer

    surrogate

  8. 8
    A
    _____
    key is a key whose values have real-world meaning, such as a state code or social security number.
    Hint

    These are 'naturally' occurring identifiers in the real world.

    Answer

    natural

  9. 9
    A
    _____
    key is a natural key composed of multiple meaningful parts, such as a product code that encodes category and subcategory.
    Hint

    This key is 'smart' because its parts carry meaning.

    Answer

    intelligent

  10. 10
    A
    _____
    key is a specific type of composite key where every attribute in the key is a foreign key to another table.
    Hint

    This term is often used for keys in junction tables.

    Answer

    compound

  11. 11
    When a robust real-world unique identifier exists, a
    _____
    key is often a good choice for the primary key.
    Hint

    Use something already in the real world.

    Answer

    natural

  12. 12
    When no suitable natural key exists, a
    _____
    key is typically a sensible choice for the primary key.
    Hint

    Invent an artificial identifier.

    Answer

    surrogate

  13. 13
    A surrogate key's values are
    _____
    and only have meaning inside the database.
    Hint

    They don't reflect real-world facts.

    Answer

    arbitrary

  14. 14
    The property of an identifier that ensures its values are unlikely to change over time is called
    _____
    .
    Hint

    Consider if the identifier might change in the future.

    Answer

    stability

  15. 15
    A key is considered
    _____
    if it contains only the attributes necessary to ensure uniqueness, with no extra attributes.
    Hint

    You cannot remove any attribute without losing uniqueness.

    Answer

    irreducible

  16. 16
    A primary key column cannot contain
    _____
    values because null is not a value.
    Hint

    This represents an unknown or missing value.

    Answer

    null

  17. 17
    The state capital attribute is not a candidate key for US states because it lacks
    _____
    .
    Hint

    Capitals can change over time.

    Answer

    stability

  18. 18
    A
    _____
    constraint ensures that values in a column must match values in the primary key column of another table.
    Hint

    It links tables together.

    Answer

    foreign key

  19. 19
    A foreign key constraint ensures
    _____
    integrity between two tables.
    Hint

    It ensures that references are valid.

    Answer

    referential

  20. 20
    When a table has a composite primary key, any foreign key referencing that primary key must also be
    _____
    .
    Hint

    The foreign key must have the same number of attributes.

    Answer

    composite

  21. 21
    To enforce uniqueness of a candidate key that is not the primary key, we can designate it as an
    _____
    key (or use a unique constraint).
    Hint

    It's an alternative to the primary key.

    Answer

    alternate

1 of 21
Question 1 of 21

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent