CS125 Project, Part 7

Due PRIOR TO class, Friday Dec. 12, 2003

Part 7 of Your Project

Your final assignment is to build a "user-friendly," interactive application program front end to your Project using one of the programming languages supported by PostgreSQL.  These include: C, C++, Python, Lisp and Java.  There is also an ODBC driver that may be used. You can find documentation on most of these options at the PostgreSQL Client Interfaces site.  (If you want to use Lisp, check with me for info on the Lisp interface to PostgreSQL.)  Regardless of your selected language, you will be turning in your code, which should be appropriately documented.  An option is to build a Web interface for your interface (although this may involve additional extra work on your part).

Your program should consist of a continuous loop in which:

A list of at least five alternative options is offered to the user. An additional alternative should be quit.
The user selects an alternative.
The system prompts the user for appropriate input values.
The system accesses the database to perform the appropriate queries and/or modifications.
Data or an appropriate acknowledgment is returned to the user.

You should include both queries and modifications among your options. For example, if your PDA were about dealers, cars and drivers, you might offer options such as
  1. Look up the price of a given car at a given dealer.
  2. Find the dealer with the lowest price for a given car.
  3. Given a driver, find all the other drivers that shop at least one dealer in common.
  4. Add a new car to the cars relation.
  5. Increase all the prices at a given dealer by a given amount.
  6. Quit.

I am not expecting anything fancy in the way of interface. For example, if you do not use a Web form, then a menu printed via printf is OK. Also, handling of SQL errors can be quite simple. As a minumum, write an sqlerror routine that just prints the error message from PostgreSQL.  I am especially interested in how effectively you can utilize the database schema you have designed to support interesting and/or engaging user interactions. 

Submit your program and sufficient documentation for me to run it.  At this point, your database should be populated with meaningful data.  This means that the values of attributes in your relations should not be random strings.  As before, please create a tar (or zip) file named <your-db-name>p7.tar and expands to create a directory <your-db-name>p7, which contains any files relevant to your program for this assignment.

If you build a Web interface to your database that allows the sorts of options described above, then in addition to your code, please submit the URL and some sample data values that will give nontrivial responses to your queries. In this case, your project should be kept on some server that is normally available, such as with your student home page or a machine that you control that happens to have static IP address.


You will have 4 to 5 minutes in class on Wednesday or Friday December 10th or 12th to demonstrate your program.  You should prepare a short presentation that describes the features of your Project and exercises the functions of the interface as described above.  You are not required to demonstrate every interface option if you want to spend more of your time describing interesting features of your Project.  (However, I will be testing every option with several inputs so make sure they all work.)

Since each of you will be demonstrating your Project from my laptop, make sure you submit your assignment with all necessary files by the due date and time (12:45pm on the due date). 

Acknowledgements:  Most of the material for the project descriptions and assignments has been taken from Professor Ullman's website.