Question
Question 2. Write the SQL queries for the following items, considering the SQL Query Optimization Techniques studied in classes. (a)List all the actors who have
Question 2. Write the SQL queries for the following items, considering the SQL Query Optimization Techniques studied in classes.
(a)List all the actors who have not acted in any movie between 2015 and 2020.
(b)Find how many movies are there in each genre.
(c)Consider the following query specified on Movie database:
SELECT A.act_lname
FROM actor A, movie_cast C, movie M
WHERE M.mov_title = The Dig AND M.mov_id = C.mov_id
AND A.act_id = C.act_id AND A.act_gender = M
(c.1) Draw the initial query tree of this query, then draw the resulting query trees after the applications of the following heuristic optimization query steps:
(c.2) Moving SELECT operations down to the query tree.
(c.3) Applying the more restrictive SELECT operation first.
Question 3. Consider the following database schema:
Movie (movieID, title, length, year) Studio (movieID, studioName)
(a)Write down the query to find the titles and years of movies made by FOX that are atleast 100 minutes long.
(b)Show the initial query tree for the previous query.
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