In this lab exercise, we'll work with SQL in the movies database (movies.mdb).
The Movies Database Schema
Divide into teams of 2 (or 3) and re-familiarize yourselves with the Movies database schema.
Writing SQL Queries
Use Access's SQL editor to write SQL commands that determine the following information:
- List all the performers' names.
- How many performers are there in the database?
- List all the movies in reverse chronological order.
- List the IDs of the performers that acted in some movie.
- Find the names of all the movies in which Gene Hackman played a role.
- List the movies and the number of performers in them.
- List the movies and with at least 5 performers.
- What movie had the most performers?
- Get a list of the full names of the performers and the titles of the movies they acted in.
If you get stuck, you can revert to using Access's graphical query editor and then switch to SQL mode to see the SQL "translation". Be sure, however, that you understand the SQL and can produce it in isolation if necessary. Note also, that Access produces slightly more complicated join conditions for multiple table queries that I won't expect you to know.
Adding New Data
Here, I'll provide you with some data that you should import into the movies database using the method we discussed in class.
Checking In
Before leaving, submit a text version of your last query.
Back to the top