CS 4604 Course Project: Step 6

Date Assigned: November 8, 2002
Date Due: November 15, 2002, in class, before class starts

  1. (16*5=80 points) Write five different queries on your database, using the SELECT/FROM/WHERE construct provided in SQL. Your five queries should preferably illustrate several different aspects of database querying, such as:

    • Queries over more than one relation (by listing more than one relation in the FROM clause)
    • Queries involving aggregate functions, such as SUM, COUNT, AVG etc.
    • Queries involving complicated selects and joins, and/or subqueries
    • Queries involving GROUP BY, HAVING or other similar functions.
    • Queries that require the use of the DISTINCT or ALL keyword.

    Caution: Do not cookup query problems to cover each and everyone of the above aspects! You do not have to illustrate all the above aspects, just the ones that occur "naturally" and seamlessly into your application. So, try to infuse some reality into your project and think of some reasonable queries that people would want to use with your application. For example, in a movie application, writing a query such as "Find all actors whose ages are three times more than their street number" sounds ridiculous!! You will not lose points if you do not cover all the above aspects.

  2. (20 points) If you were to create some indices on your tables to speed up query processing, which attributes would you place these on? Why? Why not? Notice that this is a theory question; you do not have to experiment with creating indices on your recommended attributes. Look through your course notes for more information on indices.


What to turnin:

A paper copy that details the following:
  1. List of your defined SQL schemas, just to remind us.
  2. List of the SQL queries that you tried out and the answers. If an answer is long (and runs to several pages), please include just enough of the answer in your final report so that we know what is going on and mention that you truncated the final output. Do not include pages and pages of answers, please!
  3. Answer to question 2 above.


Return Home