Chris Pollett>Old Classes>CS220, Fall 1998>Hw5

CS 220
HW#5

Do three out of four problems. Plus two bonus for doing all four. Due start of class Tuesday Dec 8 Read O'Neil Chapter 4.

1. Using Postgres create a table Employee with attributes ssn, 
fname,minit,lname,dept_no,salary. Insert some test rows into this 
table. Write an embedded sql program which queries users for an amount and 
returns lname,dept_no, and salary of all employees with salaries above 
amount. Submit a print-out of this code along with a sample session 
showing it works.

2. Implement the agent table of the CAP database on postgres. Then create 
a table bad_agents which inherits from agent but has the additional 
attribute kick_back. Insert some rows into this table. Print out both tables.
Then print out a scripted session where you illustrate the with some
select the basic properties of inheritance.

3. Use Access to make a form for orders in CAP database. The form should have
entries for all the attributes of orders. On entering the dollars attribute;
however, a macro should be triggered which computes the dollar amount using
the formula: dollars = qty*price -.01*qty*price*discnt. Do a screen 
capture to print out your macro and the design view of the components of 
your form.

 
4. Suppose commisions on orders with dollar amounts over $300 are taxable
at a rate of 5% of the total commision amount. Using Access create a 
report which prints out agents, the commission they made on orders over 
$300 and the amount of their tax. At bottom of report print total amount 
of tax that can be collected. Submit a print out of this report, together 
with screen captures of the design view of the components of your report.