CS 374 Exam #1 Preparation
James Madison University, Spring 2022

About the Exam

The following samples will give you an idea of the structure and length of the midterm. Sample exams are not a study guide. In other words, they do not provide information about what you should and/or shouldn't study. You should avoid focusing too much attention on the specifics of these questions. The answers to these exams are available on Canvas. For best results, don't look at the solutions until you have attempted these exams.

Written Portion

Anything we have done in class this semester could be on the exam (except for Python programming). If you haven't done so already, please compare the Homework Solutions with your own submissions. Principles of Database Management (our textbook) comes with a Quiz Tool that you can use for additional practice.

Sample Written Exam (Spring 2019)

Queries Portion

This exam will be computer-based. You may only run pgAdmin, a text editor, a terminal, meld, and a web browser. All windows should be arranged so that the instructor can see what you're doing. You may not refer to previous homework or use any pre-existing code. The point is to see what you can do on your own.

Here is what the exam will look like:

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

  2. Write the INSERT, UPDATE, and DELETE statements using the secN database.

  3. Write the next set of queries using the imdb database. (see imdb diagram)

  4. Write the last set of queries using the tpch database. (see tpch diagram)

  5. Download the solution's output and compare your answers using meld:

  6. export PGHOST=data.cs.jmu.edu
    export PGDATABASE=postgres
    export PGUSER=jmu username
    export PGPASSWORD=student number
    
    psql -q < exam1.sql 2>&1 | tee exam1.txt
    
    meld exam1-sol.txt exam1.txt &
    
  7. Submit your sql file via canvas.jmu.edu by the end of the exam period.