question archive Exercise 9

Exercise 9

Subject:Computer SciencePrice: Bought3

Exercise 9.4.1: Using our running movie database:

Movies(title, year, length, genre, studioName, producerC#)

Starsin(movieTitle, movieYear, starName) MovieStar(name, address, gender, birthdate)

MovieExec(name, address, cert#, netWorth)

Studio(name, address, presC#)

write PSM procedures or functions to perform the following tasks:

a) Given the name of a movie studio, produce the net worth of its president.

b) Given a name and address, return 1 if the person is a movie star but not an executive, 2 if the person is an executive but not a star, 3 if both, and 4 if neither.

c) Given a studio name, assign to output parameters the titles of the two longest movies by that studio. Assign NULL to one or both parameters if there is no such movie (e.g., if there is only one movie by a studio, there is no "second-longest").

d) Given a star name, find the earliest (lowest year) movie of more than 120 minutes length in which they appeared. If there is no such movie, return the year 0. e) Given an address, find the name of the unique star with that address if there is exactly one, and return NULL if there is none or more than one.

f) Given the name of a star, delete them from MovieStar and delete all their movies from Starsin and Movies.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE