Do the following exercises, using the most appropriate technology from SQL, stored procedures, functions or
triggers: Use the new movies database from the lab; see cs342/databases/imdb/*
Auditing — Implement a “shadow” log that records every update to the rank of any
Movie
record. Store your log in a separate table ( RankLog
) and include the ID of the user who made
the change (accessed using the system constant user
), the date of the change (accessed using
sysdate
) and both the original and the modified ranking values.
Store this in homework08_1.sql
.
Bacon Number — Implement a tool that loads a table (named BaconTable
) with
records that specify an actor ID and that actor’s Bacon
number. An actor’s bacon number is the length of the shortest path between the actor and Kevin
Bacon (KB) in the “co-acting” graph. That is, KB has bacon number 0; all actors who acted in the
same movie as KB have bacon number 1; all actors who acted in the same movie as some actor with Bacon number
1 but have not acted with Bacon himself have Bacon number 2, etc. Actors who have never acted with anyone
with a bacon number should not have a record in the table. Stronger solutions will be configured so that the
number can be based on any actor, not just Kevin Bacon.
Store this in homework08_2.sql
.
Complete the programming elements for the lab exercises.
We will grade your work according to the following criteria: