COMP3311 22T3 Assignment 1
Submitting your Assignment
Database Systems
Last updated: Wednesday 1st March 4:49am
Most recent changes are shown in red ... older changes are shown in brown.

[Assignment Spec]  [Database Design]  [Examples]  [Testing]  [Submitting]  [Fixes+Updates]


Definition: in the instructions below, the phrase "CSE server" refers to any of the Vlab server (e.g. vx2, vx5 but NOT d2) or any of the large CSE servers (e.g. williams or wagner). You can store your ass1.sql file on any of these servers, but you can only run PostgreSQL on d2 or your home machine.

How you submit your assignment depends on where your ass1.sql file is located.

If your ass1.sql is on your home machine and if you are supremely confident that it will work ok on the CSE servers, then the easiest way to submit is via Webcms3.

If your ass1.sql is on your home machine and if you are sensible, you will first copy your ass1.sql file to a CSE server, test it there, and then submit via the give command:

give cs3311 ass1 ass1.sql

Do NOT run give on d2. It may work and submit your files, or it may not.

Testing your code involves interacting with two servers: d2 and any CSE server. The code files, however should only be placed on a CSE server.

Here's a suggestion for managing your work:

# on a CSE server
vlab$ mkdir  -p  /home/$USER/cs3311/ass1
vlab$ cd /home/$USER/cs3311/ass1
# create your ass1.sql file here
vlab$ vi ass1.sql   # or your favourite editor

# on the d2 server
vxdb2$ p1   #  run your PostgreSQL server
vxdb2$ cd /home/$USER/cs3311/ass1

# if you don't already have an ass1 database
vxdb2$ createdb ass1
vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/ass1.dump

# load your code
vxdb2$ psql ass1 -f ass1.sql

# do some manual testing via e.g. select * from q1;
vxdb2$ psql ass1

# load the checking code
vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/check.sql
vxdb2$ psql ass1
ass1=# select * from check_all();
ass1=# \q

Repeat the last few steps (from load your code on) until either check_all() says "correct" for all the test cases, or until you give up trying to fix the ones that aren't correct.

Then submit you work using give as above.

After submissions have closed, we will test your work like this:

# drop any old database and make a new one
vxdb2$ dropdb ass1
vxdb2$ createdb ass1
vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/ass1.dump

# load your code
vxdb2$ psql ass1 -f /Your/Submitted/ass1.sql

# load the checking code
vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/check.sql
vxdb2$ psql ass1
ass1=# \o results
ass1=# select * from check_all();
ass1=# \q

# check the results file for number correct

# drop any old database and make a new one
vxdb2$ dropdb ass1
vxdb2$ createdb ass1

vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/ass1.dump2 # load your code vxdb2$ psql ass1 -f /Your/Submitted/ass1.sql # load the checking code vxdb2$ psql ass1 -f /home/cs3311/web/22T3/assignments/ass1/check2.sql vxdb2$ psql ass1 ass1=# \o results ass1=# select * from check_all(); ass1=# \q

The files ass1.dump2 and check2.sql provide a slightly different database (same schema, different data) and a different set of tests appropriate for that database. The differences may include things like a collaboration beer involving three breweries, etc.