A primary key
Provide your answers to the following questions:
· What is a primary key? Are duplicate primary keys allowed? Why or why not?
· What is the difference between a natural key and an invented key? Which type is most commonly used in business information processing?
· What is a foreign key? Why are foreign keys used or required in a relational database? Are duplicate foreign key values allowed? Why or why not?
Sample Answer
What is a primary key? Are duplicate primary keys allowed? Why or why not?
A primary key is a field or group of fields in a database table that uniquely identifies each record in the table. Duplicate primary keys are not allowed because they would violate the uniqueness constraint of the primary key. The primary key is used to identify a particular record in a table, and if there were two records with the same primary key value, it would be impossible to tell which record was which.
What is the difference between a natural key and an invented key? Which type is most commonly used in business information processing?
A natural key is a field or group of fields that naturally identifies a record in a table. For example, the customer ID field in a customer table would be a natural key because it uniquely identifies each customer in the table. An invented key is a field or group of fields that is not naturally associated with a record in a table, but is used to uniquely identify the record. For example, a randomly generated number could be used as an invented key.