CS145 Assignment #7
Due Tuesday, June 3, 1997
Step 7 of Your PDA
Your PDA assignment for this week is to build a user-friendly
interactive application program front end to your PDA
using the C or C++ programming language and embedded SQL.
There is a
Guide to the Oracle Pro*C Embedded SQL
System available to give you the basics of this facility.
Your program should consist of a continuous loop in which:
You should include both queries and modifications. For example,
if your PDA were
about bars, beers, and drinkers you might offer options
- 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
- The system accesses the database to perform the
appropriate queries and/or modifications.
- Data or an appropriate acknowledgment is returned to the user.
Look up the price of a given beer at a given bar.
Find the bar with the lowest price for a given beer.
Given a drinker, find all the other drinkers that frequent at least one
bar in common.
Add a new beer to the Beers relation.
Increase all the prices at a given bar by a given amount.
We are not expecting anything fancy in the way of interace.
For example, a menu printed via printf is OK.
Also, handling of SQL errors can be quite simple.
Either write an sqlerror routine that just prints the error
message from Oracle or copy the error handler from a sample program
(of course you should acknowledge this borrowing just as you would
acknowledge any other use of someone else's work in your homework or
Hand in your program and a script showing the program running.
Each of the options should be exercised at least once in your
Exercise 4.3.1(e) [p. 208].
Exercise 4.3.4(c) [p. 209].
Exercise 4.4.2(b) [p. 222].
Exercise 5.10.1(c) [p. 323].
Note this question is the same problem as (3), in the SQL3 notation.
Exercise 8.2.1(b) [p. 426].
Exercise 8.2.1(e) [p. 426].
Exercise 8.3.2(c) [p. 433].