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: