Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

2. To compare the costs of alternative training programs.

Answered: 1 week ago