1. What is a Primary Key and why is it important in a relational database? (Do not use the term autonumber in your answer)

 

 

Primary keys are attribute(s) designated to uniquely identify a row in a table.  They cannot be null and must be unique.  Primary Keys are also used to show relationships between tables in the database structure.

 

 

 

  1. Which one of the options below is used to define the structure of a database?
    Circle one

A)     Queries

B)    Schema

C)     Tables

D)     Forms

 

 

  1. What is a one-to-many relationship in a relational database?  Give an example with your answer.

 

A one-to-many relationship between two tables in a relational database means that the Primary key attribute of the one migrates to become the foreign key attribute in the many. 

 

OR

 

A one-to-many relationship means that a single row in the one table may have one or many rows associated with it in the many table.

 

Example:

 

The student table and the advisor table in labs 15-18 represented a one-to-many relationship.  A single advisor (single row in Advisor table) may have many students (rows in the student table) assigned to them, but each student will have one and only one advisor.

 

 

  1. Database redundancy is very, very bad.  Explain.

 

If the same data is copied in multiple tables (or multiple times within a table) it is hard to update and know that you have changed every single record where the redundant data appears.  These are update anomalies.

 

Redundant data leads to data anomalies and ultimately, to inconsistent data.  Inconsistent data is bad data and bad data leads to bad decision.

 

 

  1. Using Visual Basic, declare an array variable with the name Continent.  The array holds 7 elements with string values.

 

Dim Continent (6) As String