Question
Consider the following relation schema; the schema describes a database containing information about movies. The movie relation includes information about the id, title and year
Consider the following relation schema; the schema describes a database containing information about movies. The movie relation includes information about the id, title and year in which it was released. The actor relation includes id, name and gender of the actor. The casting relation provides information about which actor was casted for which movie. Domain of each field is listed after the field name.
movie(movieid:integer, title:string, year:integer)
actor(actorid:integer, name:string, gender: string)
casting(movieid:integer, actorid:integer) Express the following queries in relational algebra expression:
a) Find the names of all actors who have been casted for the movie Iron Man.
b) Find the name of all actors who dont work in any movie.
c) List the titles of movies for which Marilyn Monroe worked.
d) List the id of the movies done by some female actors.
e) List the id of the movies done by only male actors.
f) Find the ids of the actors who worked for at least two movies.
g) Find the ids of the actors who worked for only two movies.
h) Find the ids of the actors who worked for at most two movies.
i) List the titles of the movies that was released after 1990 and casted Bruce Wayne for the lead role.
j) Find the pairs of the actors who were casted in the same movie. [Bonus: If you are returning a, b then it should not return b,a]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started