CPSC 203: Introduction to computers  

James Tam

Final exam review: Databases

Written question

Given the table "Games' shown below you are to form the SQL queries in order to form the SQL queries specified for each question.

Games

ProductNo (primary key)

Title

YearReleased

Developer

Price

Genre

1

Pool of radiance

1980

SSI

$2.50

Role playing

2

Silent Hill 3

2000

Konami

$24.99

Horror

3

MW 2: Mercenaries

1991

Activision

$8.00

Simulation

4

Wing Commander IV: The Price of Freedom

1993

Origin

$9.99

Simulation

5

MW2: 31st Century Combat

1990

Activision

$7.99

Simulation

6

DDR Extreme 2

2005

Konami

$33.00

Simulation

7

MW3

1990

Atari

$12.50

Simulation

Question 1: Show title and developer information for all the Konami games: [Solution]

Question 2: Show all the game titles that start with "mw": [Solution]

Question 3: Show the title and year release for games that were released after 1990: [Solution]

Question 4: Show the title, developer and price for "cheap" games that you can buy which are less than $8: [Solution]

 

Multiple choice questions

 
  1. In terms of databases which of the following best describes what is a primary key?
   
  1. It uniquely identifies records
  2. It must be comprised of only one field
  3. It must be a composite of multiple fields
  4. More than one of the above selections is true.
  5. None of the above
 
 
  1. Which of the following statements is true of databases?
   
  1. A primary key in one table must always correspond to a foreign key in another table.
  2. All fields in database in first normal form either contain one value or it is null.
  3. Using an input mask is how referential integrity is ensured.
  4. All of the above are true.
  5. None of the above are true.
 
       

[Multiple choice key]