SQL Assessment
Preparation
Create and populate the DVD Rental database on your laptop using its database dump. The database dump contains SQL statements that will restore the database when the file is executed (e.g., by opening the file in pgAdmin’s Query Tool).
Review the schema of the DVD rental database, including its ER diagram, to familiarize yourself with it. You may also complete the queries provided below to assist with this process.
Download the solution file to complete during the assessment.
Queries
The following practice queries are intended to familiarize you with the DVD Rental database. These queries are not related to the assessment itself. There is no penalty for not completing them, and you may work on them with others. (solutions)
-
Retrieve the first name, last name, and email address of all customers living in London, United Kingdom. Sort the results by email address in ascending order.
-
Retrieve the category of all films rated G. Do not include duplicates in the results. Sort the results by category in ascending order.
-
Retrieve the first name, last name, and total amount spent by each customer who has spent at least $100. Sort the results in decreasing order of the amount spent, using the customer id to break ties.
-
Retrieve the title, rating, and language of all films that have never been rented. Sort the results by title in ascending order.
-
Retrieve the first and last name of the actors and actresses who appear in a film that contains “water” in its title and who appear in a film that contains “bow” in its title. Either “water” or “bow” may be capitalized. Sort the results by the actor id in ascending order.
Notes
Authorized resources during the assessment are as follows:
- DVD Rental database and corresponding ER diagram
- PostgreSQL and pgAdmin
- PostgreSQL documentation
- Solution file to record your answers
- Comp Sci 364 textbook
Your laptop’s wireless network connection must be turned off during the in-class assessment.
Submission Instructions
When you complete the assessment, do the following:
- Save your solution file (save frequently throughout the assessment!)
- Return the assessment to your instructor
- Request permission from the instructor to enable your laptop’s wireless network connection
- Upload your solution file to Blackboard