Starting from:

$29.99

Assignment 2 SQL expressions

CSE 180 Database Systems I
Lab Assignment 2
1 Introduction
In this assignment, you are asked to write a number of SQL expressions that perform queries on the movie
database created in the previous assignment. The queries should correctly run on the PostgreSQL server.
2 Queries
(Q1) “List records from the Actors relation who were born before 1960”
(Q2) “List all the relevant information (all attributes in Actors and MovieRoles) of actor who have played in
at least one role, and have an actorid between 4 and 8 (inclusive)(you MUST use at least one LEFT
JOIN command)”
(Q3) “List the name of actors who have played in at least one role, and have an actorid between 4 and 8
(inclusive)(you MUST use at least one EXIST command)”
(Q4) “List the movies whose ratings in both the Reviews and Imdb relations are larger than 7.5”
(Q5) “List movies whose names show up in their associated review text of the Reviews relations”
(Q6) “List the names of actors who have worked in the same movies, grouped by the director’s name (you
MUST use at least one GROUP BY command)”
(Q7) “List all actors who played themselves in a movie, along with the movie name(s)”
(Q8) “List movies who someone might enjoy, if they also enjoyed Sherlock Holmes: A Game of Shadows
(HINT: you are able to manually segment the genre information before writing this query)”
(Q9) “List movie recommendations for someone who likes scary movies that are also funny”
(Q10) “List all actors whose last name start with an H”
(Q11) “List all actors who played a role in The Terminator (you MUST use at least one IN command)”
(Q12) “List all movie titles, sorted by their associated IMDb rating”
(Q13) “List all movie roles, sorted alphabetically, where the movie was released before the year 2000, and
there is at least one male actor in the movie”
3 Submission
Save the commands issued and the corresponding query results in a file named Queries.txt. Upload this file
to the Lab Assignment 2 submission page on Canvas by 11:59pm on Friday May 1th.
1

More products