0% found this document useful (0 votes)
19 views1 page

Exercise 2 Lab7

This document contains the solutions to 6 questions for an exercise involving querying data from tables related to movies, reviewers, ratings, genres, directors, and actors. The questions select data from these tables to find reviewers with high ratings, unrated movies, reviewer names and ratings and movie titles ordered by reviewer name, genre counts, and details of the shortest movie including title, year, director names, actor names and roles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Exercise 2 Lab7

This document contains the solutions to 6 questions for an exercise involving querying data from tables related to movies, reviewers, ratings, genres, directors, and actors. The questions select data from these tables to find reviewers with high ratings, unrated movies, reviewer names and ratings and movie titles ordered by reviewer name, genre counts, and details of the shortest movie including title, year, director names, actor names and roles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

JUDY AHMED

ID: 202112129
EXERCISE 2
QUESTION 1
SELECT reviewer.rev_name FROM reviewer, rating WHERE rating.rev_id = reviewer.rev_id
AND rating.rev_stars>=7 AND reviewer.rev_name IS NOT NULL;
QUESTION 2
SELECT mov_title FROM movie WHERE mov_id NOT IN ( SELECT mov_id FROM rating );
QUESTION 3
SELECT rev_name, mov_title, rev_stars
FROM reviewer, rating, movie
WHERE reviewer.rev_id=rating.rev_id
AND movie.mov_id=rating.mov_id
AND reviewer.rev_name IS NOT NULL
AND rating.rev_stars IS NOT NULL
ORDER BY rev_name, mov_title, rev_stars;
QUESTION 4

QUESTION 5
SELECT gen_title,COUNT(gen_title) FROM movie NATURAL JOIN movie_genres
NATURAL JOIN genres GROUP BY gen_title;
QUESTION 6
SELECT mov_title, mov_year, dir_fname, dir_lname,
act_fname, act_lname, role
FROM movie
NATURAL JOIN movie_direction
NATURAL JOIN movie_cast
NATURAL JOIN director
NATURAL JOIN actor
WHERE mov_time=(SELECT MIN(mov_time) FROM movie);

You might also like