CS 374 GP3: Example Queries
James Madison University, Spring 2022

Draft submission due Mar 10th in class.
Each group commits a queries directory on GitHub.

Overview

The main goal of this assignment is for you to finish designing your database and determine what type of results your project will display. We will begin implementing the front-end (i.e., the web-based interface) during GP4. You have three main objectives at this point:

  1. Revise your schema design, based on your experience writing queries for HW4 and initial feedback about GP2.

  2. Write five or more queries that show compelling results. Your queries should be both interesting and comprehensive.

  3. Run your queries to populate example Google Charts. The charts must directly address the vision from your proposal.

These three steps should be an iterative process. You may find, while writing queries, that you are missing some of the data you need. In that case, you should revise and rerun your scripts from GP2. Be sure to commit any changes you make to your code in GitHub, and document each revision with a "-m" message.

SQL Queries

Example file:   deccnt_state.sql

Create a queries directory in your git repository, and create a separate .sql file for each query. Like before, each member of your group must make at least one commit, and all commits should have a brief "-m" message in the git log.

Write each query either as an SQL view or an SQL function. The filename should match the view/function name, and each file should contain a brief comment at the top that explains the query in English.

In contrast to the deccnt_state example, your queries should do more than simply look up rows in the database. Consider ways to analyze the data, show statistical results, and identify interesting trends.

HTML Charts

Example file:   deccnt_state.html

For each query you write, create an HTML file with the same name. Run the query with meaningful parameters, and display the results in an HTML Chart. Eventually your app will do this step automatically, but for this assignment you will do it by hand.

Determine what kind of chart would best summarize the results. Then copy the corresponding example code from the Chart Gallery, and modify it to display the actual results from your queries.

The chart data must be returned by a single view or function call. If you need to call multiple views/functions or join the same view/function multiple times, then your design is incorrect.

Above the chart, show the SQL you used to call the function (including parameters) in a pre tag and the query results in a Table chart. Feel free to arrange and style these elements however you like.