You are on page 1of 2

Types of Database, Primary Keys and Foreign Keys

The database below includes two tables. The database is used to keep a record of which customers have borrowed movies from a library.

Movie Stock Table:

Movie Barcode Movie Title Main Actor Year of Release Age Certificate
0001 Titanic Leonado De-Caprio 1997 PG
0002 The Innkeepers Sara Paxton 2011 15
0003 The Godfather Marlon Brando 1972 18
0004 Fight Club Brad Pitt 1999 15
0005 Raiders of the Lost Ark Harrison Ford 1981 PG

Customer Borrowing Table:

Customer Number Customer Name Telephone Number Movie Barcode Date Due Back
T567121 Mr Ned Flanders 222 004 067 0002 20/04/2012
M76543 Mr Michael Jordan 123 990 546 0003 27/04/2012
M58899 Mrs Rose Madder 222 758 333 0005 20/04/2012
F567894 Mr Carl Malone 879 222 546 0003 23/04/2012
F987654 Mrs Sonia Flagg 879 231 563 0001 30/04/2012

Questions:

A. How many records are there in the Movie Stock Table? Answer:

B. How many fields are there in each record in the Customer Borrowing Tables? Answer:

C. What type of database is being used here? (circle) Flat File / Relational

Mr Nicholls – ICT Department


D. What is the Primary Key in the Movie Stock Table? Answer:

E. What is the Primary Key in the Customer Borrowing Table? Answer:

F. Which field is the Foreign Key in the Customer Borrowing Table? Answer:

G. Which Data Type would you use in the Date Due Back field? Answer:

H. Which movie is on-loan to 2 different people? Answer:

I. Which movie is currently not on loan at all? Answer:

J. Name the data types for each of the other fields:

Movie Barcode:
Movie Title:
Main Actor:
Year Released:
Age Certificate:
Customer Number:
Customer Name:
Telephone Number:

Mr Nicholls – ICT Department

You might also like