Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

General instructions: You can work in teams of up to 4 members. Only one member of the team should submit the assignment. Submission: upload your

General instructions: You can work in teams of up to 4 members. Only one member of the team should
submit the assignment.
Submission: upload your submission files on e-Class. Each file should contain, at the beginning of the file,
the last name, first name, and student number of all the team members.
Consider a relational schema for storing information related to movies:
Actor(name, YofB, country_of_birth, bio, gender)
Director(name, YofB, country_of_birth, bio, gender)
Producer(name, YofB, country_of_birth, bio, gender)
Crew(name, YofB, country_of_birth, bio, )
Country(code, country_name, description)
Movie(title, release_year, genre, budget, cost, gross_earnings)
DirectorMovie(d_name, d_YofB, m_title, m_year)
ActorMovie(a_name, a_YofB, m_title, m_year)
CrewMovie(c_name, c_YofB, m_title, m_year)
ProducerMovie(p_name, p_YofB, m_title, m_year, p_type)
Foreign key constraints:
Actor[country_of_birth] Country[code]
Director[country_of_birth] Country[code]
Producer[country_of_birth] Country[code]
DirectorMovie[d_name, d_YofB] Director[name, YofB]
DirectorMovie[m_title, m_year] Movie[name, release_year]
ActorMovie[a_name, a_YofB] Actor[name, YofB]
ActorMovie[m_title, m_year] Movie[name, release_year]
ProducerMovie[p_name, p_YofB] Producer[name, YofB]
ProducerMovie[m_title, m_year] Movie[name, release_year]
CrewMovie[c_name, c_YofB] Crew[name, YofB]
CrewMovie[m_title, m_year] Movie[name, release_year]
2
In addition:
No attributes are allowed to have NULL values.
Attributes YofB (year of birth), release_year, budget, cost and gross_earnings have integer values,
e.g.,1978,2023,1000234.
All other attributes have strings as values. Attribute code has as values strings such as,CA,
GBR. Attribute genre in table Movie has as values one of {comedy,drama,tragedy,
musical,horror}. Attribute p_type in table ProducerMovie has as values one of {executive
producer,assistant producer,producer}.
Part 1.[30 points] Write Relational Algebra expressions for the following queries. Use only the
operators presented in class. Do not use extended Relational Algebra operators, e.g., grouping,
counting, etc.
a. List the name and year of birth of all those who acted in at least two movies which they also
directed.
b. List the name and year of birth of all directors who were younger than all the actors cast in the
movies they directed, at the time the movie was released. (The persons returned by this query may
be associated with movies in other capacities as well, e.g., as actors, directors, executive
producers, etc. Person A is younger than person B is the age of person A is less or equal to the
age of person B.)
c. List the name and year of birth of all producers who only produced in one type of movie, for
example only acted in comedies. (The persons returned by this query may be associated with
movies in other capacities as well, e.g., as actors, directors, etc.)

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

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

5 What are the ongoing challenges for HRM?

Answered: 1 week ago

Question

4 What typifies the first and second waves of HRM?

Answered: 1 week ago