Do the following exercises:

  1. Write a PL/SQL procedure that receives two movie IDs and an integer amount and “transfers” a given amount of rank value from a source movie to a destination movie. Note that this doesn’t make much sense in the context of the movie database, but it’s similar to money transfers in a banking database.

    Your procedure should be designed in such a way that it can be run simultaneously by the following sample script to separate threads and still give a consistent result.

    BEGIN
    	FOR i IN 1..10000 LOOP
    		transferRank(176712, 176711, 0.1);
    		COMMIT;
    		transferRank(176711, 176712, 0.1);
    		COMMIT;
    	END LOOP;
    END;

    This script moves rank points between two movies (Kill Bill 1 and Kill Bill 2). Note the following.

    Store your solution in homework10.sql.

  2. Complete the programming elements for the lab exercises.

Checking in

We will grade your work according to the following criteria: