Advanced Database Management
90-758
Spring 1998
Take Home Final Exam
(Due: Monday, April 27, 1998)
Group Members:
1.____________________________________
2.____________________________________
3.____________________________________
4.____________________________________
Question 1 (5 Points):
In a few sentences, describe the main differences between a post-query and a when-new-record-instance trigger. When does it make sense to use one and not the other?
Question 2 (5 Points):
For each of the given situations, where would be the most appropriate place to put the described trigger?
- A when-new-form-instance trigger to populate global variables shared by all blocks
- Form Level
- Block Level
- Item Level
- A when-new-block-instance trigger to automatically populate each block as it is navigated to
- Form Level
- Block Level
- Item Level
- A post-query trigger to calculate the sum of a number of items in a block and display the result in a display item
- Form Level
- Block Level
- Item Level
- A when-new-item-instance trigger containing a null statement that overrides a form level when-new-item-instance trigger highlighting an item. The form level trigger should be overridden only for one particular item
- Form Level
- Block Level
- Item Level
- A pre-delete trigger that always asks the user whether he/she is sure that the current record should be deleted, regardless of the current block
- Form Level
- Block Level
- Item Level
Question 3 (5 Points): (this one is to test how well you researched sailboats :-)
- What is the correct nautical term for the big bulbous thing that hangs off the bottom of a sailboat in order to keep it stable when under way?
- Barnacle
- Keel
- Anchor
- Jimmy Hoffa
- What is the correct nautical term for the bathroom on a sailboat?
- Latrine
- Outhouse
- Head
- Stateroom
- When cruising around the world a yacht should always fly the following flag:
- The Jolly Roger
- A "Terrible Towel"
- The flag of your favorite baseball team
- The flag of the country where the boat is from
- Which of the following would be the most logical to wear in the event you are thrown overboard?
- A straight jacket
- A life vest
- A pair of sailing gloves
- A baseball cap
- A powerboat and a sailboat under sail are on a collision course in the middle of Lake Erie. Which has the right of way?
- The powerboat
- The sailboat
- Whichever boat is bigger
- Whoever wins at playing "chicken"
Question 4 (10 Points):
Assume that your boat table (TBL_BOATS) includes the following columns:
Boat_Id Number
Boat_Name Varchar2(15)
Sold Varchar2(1) '0' = No, '1' = Yes
Also, assume that your customer table (TBL_CUSTOMERS) includes the following columns:
Cust_Id Number
First_Name Varchar2(10)
Last_Name Varchar2(15)
Boat_Id Number
Note: assume that each customer can only own one boat and that each boat has an owner.
Finally, there is a third, empty table (TBL_NEW_OWNERS) that has the following columns:
Boat_Name Varchar2(15)
Owner_First Varchar2(10)
Owner_Last Varchar2(15)
Write a procedure that takes no arguments which does the following:
Use a cursor and a loop to parse through all rows of boats that have been sold. For each sold boat, find the customer first and last names, and insert the boat name, first name and last name into the TBL_NEW_OWNERS table. Finally, make sure you commit the results to the database.
Back to Main Page