CS240A: Winter 98.


Final Exam. Two problems

Problem 1:

In writing SQL3 recursive queries, the user can control whether duplicates are eliminated or kept by using either UNION or UNION ALL, respectively, between the exit select and the recursive select.

A. Suppose that you use a recursive SQL query to compute the transitive closure of a graph. What results would you obtain under UNION and UNION ALL for both the situations where the graph has or does not have cycles? Illustrate your answer with short examples.

B. In CS240A, you have seen how recursive SQL3 queries can implemented using techniques similar to those used for recursive Datalog programs. Now explain how you would modify the differential fixpoint technique to support the UNION ALL version of a recursive SQL3 query.

Problem 2:

Implement the Boosted Naive Bayesian (BNB) Algorithm in SQL. The BNB classification algorithm was described in a presentation given on February 17th, where a Tennis Example was used as the training set.

Now, assume that you are given the following table

       FORECAST(Day, Outlook, Temp, Humidity, Wind) 
which describes the weather conditions for the next few days.

Use SQL to printout a table where a decision play/noplay is shown for each Day. Therefore, you must give SQL queries to derive the play/noplay decisions using the BNB Algorithm and the Tennis Example as its training set.

(You can use intermediate tables to connect SQL queries. You are not required to deliver running code, but you must use valid SQL syntax and semantics).

Instructions

You must turn in the final with the solutions for Projects 1, 2, and 3, and of all previous assignments, by 10:00 AM tomorrow (Friday). Put everything in an envelope addressed to me, and leave it in my mailbox--or in the `incoming mail' box under it if if that is full.