CSC 436 - Assignment #2
PostgreSQL
Due 10/30

Overview:  This assignment involves using PostgreSQL to create, populate, and query a database.

Problem Statement:
Now that you have designed the database schema for Humungo Video Stores, you will use PostgreSQL to create it.  You will populate the database with data and then query the database to get important information about the films, shoppers and inventory items.

Create the Database:
The data is the same as was described in assignment #1.  In that assignment you were to informally describe the relations in the database.  For a formal description of the relations click here.

You will create a database containing each of the relations described above.  For each relation, you will create a table making sure to define the correct attributes, and to specify the primary key, with a NOT NULL constraint.  Also make sure to correctly define foreign keys between relations.

Enter the Data:
Once the database tables have been created, you will populate the database with the data found here.  We have created a set of data files that you can use to populate most of the relations.  You will be required to fill in the data, using the SQL command INSERT, for the SHOPPER relation.  The rest of the relations can be automatically populated using the copy command.

SQL Queries:
The management at Humungo Video Stores needs to retrieve certain information about their films.  Specify the SQL queries for the questions that they want answered.  Use PostgreSQL to enter the queries and save and print out the results.

Using PostgreSQL:
For instructions on how to set up your account to use PostgreSQL and how to run it, go here.

What to turn in:

  1. A printout of the CREATE TABLE command that you used for each table.
  2. A printout of the INSERT command that you used to populate the SHOPPER table.
  3. A printout of the data in each relation you created.
  4. The printed results and SQL command for each query.
  5. Any other discussion that is required for the specified queries.
Please turn in each of these by class time on October 30.