Description
Instructions:
• Submit a text file or a pdf file with your answers. Name your file as lastnameFirstnameW2.fileExtension (e.g. chaturvediRituW3.txt). Handwritten answers will not be accepted.
https://dbis-uibk.github.io/relax/calc/gist/2ac385f07594b0e4431a441f2e454352
Movies Schema and Instance required for questions 1, 2 and 3
Movies Schema
Movies Instance
Questions
1. Write a query in RA to list all actors who play a role in every movie in which Nicholson has acted.
Your Answer:
2a. Write a query in RA to list the names of all characters in movies directed by ’Lucas’.
2b. Write a query in SQL to list names of all characters in movies directed by ’Lucas’.
3a. What is the resulting relation when the following SQL query is executed?
SELECT aName
FROM Artists NATURAL JOIN Roles NATURAL JOIN Movies
WHERE nationality = ’American’ AND director = ’Kubrick’;
3b. Rewrite 3a using a subquery.
Your Answer:
4. Write a query in SQL to report the various nationalities in the database – display them in alphabetical order.
Your Answer:
5. Write a query in SQL to report pairs of movies that have the same drector. Expected Result:
m1.title m2.title
Chinatown Repulsion
Star Wars IV American Graffiti
Shining Full Metal Jacket
Reviews
There are no reviews yet.