Lab Assignment 2

CMPS 180 Fall 02

Due Thursday October 17 at midnight

The goal of this lab assignment is for you to gain experience with SQL programming by writing SQL queries for retrieving answers to questions about a database that is provided.

The database provided with this assignment holds information about the video game Final Fantasy IX published by Square Electronic Arts L.L.C. The information stored here represents the relationships between characters, equipment, and abilities. The characters are limited in which equipment they can wear and abilities they can learn. These relationships are stored in the ffix_can_wear table and the ffix_can_learn table. The way a character learns an ability is by equipping a particular piece of equipment. The ffix_teaches table tells which abilities are taught by which pieces of equipment. For each kind of equipment (say, hat), more than one item of this equipment may be currently available, and each such item is identified by a unique serial number. The ffix_inventory table tells which kinds of equipment are currently available by listing kinds of equipment and serial numbers of items .

Schema Example Queries First, you need to download the script to create the tables. Next, you need the data . Once you have created the tables and populated them with data, you need to write queries to answer the following questions about the data. In case it is desired, I have also written a script to drop the tables when you are done.
  1. Find the names of all kinds of equipment that Dagger can wear.
  2. Find the serial numbers, names and descriptions of all equipment in inventory that Zidane can equip.
  3. Find the names and costs of all abilities that Zidane can learn, but that Steiner cannot.
  4. Find the names of all pairs of distinct abilities which are taught by the same kind of equipment
  5. Find the names and descriptions of all abilities of type 'Active' whose cost is greater than 10 that can be learned from equipment in inventory. Do not list multiple occurences of the same ability.
  6. Find the names of all characters who can learn an ability by wearing a kind of equipment with 'Hat' in the name
  7. Find the names and descriptions of all current equipment which Zidane can wear, but which teaches an ability that Zidane cannot learn

For this assignment you will submit a file which contains each of your queries in the order of the questions. Also, please submit a log file which contains the results of running your queries against the database. Last, a README file should be included which indicates the names and descriptions ofthe files you have turned in. An example submit statement is

submit cmps180-pk.f02 lab2 README query.script query.log