Question: Suppose a database has the following three relations. Student (sid: integer, fname: string, lname: string, gpa: real) Like (studentId: integer, movieId: integer) Movie (mid: integer,
Suppose a database has the following three relations. Student (sid: integer, fname: string, lname: string, gpa: real) Like (studentId: integer, movieId: integer) Movie (mid: integer, title: string, director: string, releaseDate: date) Actor (aid: integer, firstname: string, lastname: string, age: integer) ActIn (actorid: integer, movieId: integer, year: integer) (The "bit" data type stores 0 or 1. False or true. Booleans.) "studentID" in Like is a foreign key referencing "sid" in Student. "actorID" in ActIn is a foreign key referencing "aid" in Actor. "movieID" in Like and ActIn are foreign keys referencing "mid" in Movie.
You may assume simple boolean comparisons work on dates.
Write the following queries in relational algebra.
- Find the actor ids and first names of actors that have the last name "Boseman".
- Find the titles and release dates of movies liked by the student with student identifier equal to 11.
- Find the titles and directors for movies released after December 2018. (Release date greater than).
- Find the first and last names of students who like the movie titled "The Ant Man and the Wasp".
- Find the last and first names of students that like a movie directed by "Ryan Coogler".
- Find the last names of students that like a movie titled "Infinity War" and also like a movie titled "Lego Movie".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
