James Madison University, Spring 2022
Electronic submission due Feb 27th before 11:59 PM.
Each student submits a single sql file via Canvas.
PostgreSQL Queries
- Download the provided template and read the instructions at the top of the file.
- Write the first set of queries using the imdb2016 database. Here is a diagram of the important tables.
- Write the second set of queries using the tpch database. Here is a diagram of the important tables.
- You must be able to run the entire file without any errors. Test the commands below before submitting.
Note that each query specifies the exact schema and order of its result. You should compare your answers with the solution's output using meld:
export PGHOST=data.cs.jmu.edu export PGDATABASE=postgres export PGUSER=jmu username export PGPASSWORD=student number psql -q < hw4.sql 2>&1 | tee hw4.txt meld hw4-sol.txt hw4.txt &
Finally, your script must run in under two minutes. If any query is taking longer than fifteen seconds, then you are probably doing something wrong.