Database Design for Mere Mortals Ch. 8 Flashcards
State the three reasons why keys are important.
— Ensure that each record in a table is properly identified
— Help establish and enforce various types of integrity
— Serve to establish table relationships
What are the four main types of keys?
- Candidate
- Primary
- Foreign
- Non
What is the purpose of a Candidate Key?
Uniquely identify a single instance of the table’s subject
State four items of the Elements of a Candidate Key.
— Cannot be a multipart field
— Must contain unique values
— Cannot contain Null
— Its value is not optional in whole or in part
— Comprises a minimum number of fields necessary to define uniqueness
— Values must uniquely and exclusively identify each record in the table
— Its value must exclusively identify the value of each field within a given record
— Its value can be modified only in rare or extreme cases
True or False: A candidate key can be composed of more than one field.
True
Can a table have more than one candidate key?
Yes
What is an artificial candidate key?
A field you create for the sole purpose of serving as a candidate key. You create this type of key when there are no ‘naturally occurring’ candidate keys in a table
What is the most important key you assign to a table?
The primary key
Why is the primary key important?
— A primary key field exclusively identifies the table throughout the database structure and helps establish relationships with other tables
— A primary key value uniquely identifies a given record within a table and exclusively represents that record throughout the entire database. It also helps to guard against duplicate records
How do you establish a primary key?
By examining the table’s pool of available candidate keys and then selecting one as the primary key
State four items of the Elements of a Primary Key.
— Cannot be a multipart field
— Must contain unique values
— Cannot contain Null
— Its value is not optional in whole or in part
— Compromises a minimum number of fields necessary to define uniqueness
— Its value must uniquely and exclusively identify each record in the table
— Its value must exclusively identify the value of each field within a given record
— Its value can be modified only in rare or extreme cases
What must you do before you finalize your selection of a primary key?
You must make absolutely certain that it exclusively identifies the value of each field within a given record and meets all the Elements of a Primary Key
What is an alternate key?
A candidate key that was not chosen to serve as the primary key of the table
What do you ensure by establishing table-level integrity?
— There are no duplicate records in a table
— The primary key exclusively identifies each record in a table
— Every primary key value is unique
— Primary key values are not Null
Why should you review the initial table structures?
— Ensure that the appropriate subjects are represented in the database
— Make certain that the table names and table descriptions are suitable and meaningful to everyone
— Make certain that the field names are suitable and meaningful to everyone
— Verify that all the appropriate fields are assigned to each table