Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the following database schema I need help with the below questions: Database: moviesfull Tables: director id ( int , primary key, auto - increment

Using the following database schema I need help with the below questions:
Database: moviesfull
Tables:
director
id (int,primary key, auto-increment)
dir_firstName (varchar(30),not null)
dir_lastName (varchar(30),not null)
genre
id (int,primary key, auto-increment)
gen_title (varchar(10),not null)
rating
rev_id (int,not null)
mov_id (int,not null)
rev_rating (decimal(6,1),not null)
PRIMARY KEY (rev_id,mov_id)
FOREIGN KEY (mov_id)REFERENCES movie (id)ON DELETE CASCADE ON UPDATE CASCADE
FOREIGN KEY (rev_id)REFERENCES reviewer (id)ON DELETE CASCADE ON UPDATE CASCADE
reviewer
id (int,primary key, auto-increment)
rev_name (varchar(45),default null)
movie
id (int,primary key, auto-increment)
mov_title (varchar(35),not null)
mov_year (int,not null)
mov_time (int,not null)
mov_lang (varchar(15),not null)
mov_dt_rel (varchar(20),default null)
mov_rel_country (varchar(5),not null)
gen_id (int,not null)
dir_id (int,not null)
FOREIGN KEY (dir_id)REFERENCES director (id)ON DELETE CASCADE ON UPDATE CASCADE
FOREIGN KEY (gen_id)REFERENCES genre (id)ON DELETE CASCADE ON UPDATE CASCADE
Complete the problems. Use a subquery in each problem.
1.Show the movie genres with an average rating above 5for all genres except 1001.(SCREENSHOT)
2.Show all movies with more than 10ratings and are in a language other than Italian. (SCREENSHOT)
3.Show all movies with an average rating less than 10and a release year between 1958-1999.Order by year descending. (SCREENSHOT)
PART 2
Complete the following problems. #4and #6do not require a subquery
1.Show the languages of each movie released before 1965(SCREENSHOT)
2.Show all movies with more than 6ratings that are in a language different from any movie released before 1965.(SCREENSHOT)
Hint: Show all movies with more than 6ratings that are in a language Not In the result of your subquery from #4
3.Show the reviewers that have a reviewing average over 7.0(The average of all the ratings they've given is greater than 7)(SCREENSHOT)
4.Show all the movies that were rated by reviewers with an average rating greater than 7.(In other words, show all the movies that the reviewers from the previous question have rated).(SCREENSHOT)
Hint: Use the query from #6as a subquery
Complete the following problems using a subquery.
5.Show the movies that have received the highest possible rating.
Hint: The highest possible rating is the maximum rating (SCREENSHOT)
6.Show the movie genres with an average rating above 7for genres with at least 4movies.(SCREENSHOT)

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions