ITEC 340
Homework 5 & 6
San Juan Sailboat charters rents sailboats to
customers. The Rental fee for the boat
is negotiated between
Below is a sample schema for
|
Role |
MinCommission |
MaxCommission |
|
Captain |
350 |
500 |
|
First Mate |
200 |
350 |
|
Seaman |
100 |
200 |
The amounts indicate the minimum and maximum daily commission that a crew member would earn if they are hired onto a charter.
Required for
Homework 5:
Write a single script named h5.sql which creates, constrains, and populates a set of tables that implements the schema below. Your columns should be of an appropriate type (numeric, date, varchar2) Your constraints should include all PKs and FKs indicated. You should also use NN and CC constraints to enforce the following business rules:
Use the data above for your ROLES table. Insert sufficient sample data into the other tables you implement to fully articulate the relationships shown in the ERD.
Place your h5.sql script in an RU05 folder in your ITEC340 dropbox submission folder by 11:30 p.m. on Thursday, October 27th.
Required for
Homework 6:
Implement two triggers. The first trigger should be named LateFee and should automatically compute and update the Late Fee when an update of the ActualReturn field occurs. The second trigger, named ComCheck, should fire when a CrewAssignment row is inserted or when the Role or Commission fields of the CrewAssignment table are updated. The trigger should enforce the rule that a crew members daily commission is between the limits in the ROLES table at the time of the insert of update event.
Create two scripts named Trigger1.sql and Trigger2.sql that create these two triggers. Place these two scripts in an RU06 folder in your ITEC340 dropbox submission folder by 11:30 p.m. on Tuesday, November 1st.
