CS 374 HW6: Advanced SQL
James Madison University, Spring 2022

Electronic submission due Apr 10th before 11:59 PM.
Each student submits a single sql file via Canvas.

PostgreSQL Queries

  1. Download the provided template and read the instructions at the top of the file.

  2. Write the first set of queries using the dblp database. Here is a diagram of the important tables.

  3. Write the second set of queries using the jmudb database. Use pgAdmin to figure out the schema.

  4. 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 < hw6.sql 2>&1 | tee hw6.txt

meld hw6-sol.txt hw6.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.

Honor Code Statement

This assignment must be completed individually. Your submission must conform to the JMU Honor Code. Authorized help is limited to general discussion on Discord, asking questions during class, and meeting with the instructor. Copying work from another student or the Internet is an honor code violation and will be grounds for a reduced or failing grade in the course.