For this assignment, you will build a database of information about movies. Your database should start with three tables, named movies, directors, and performers. The movies table should include at least the title and year of each movie, and the directors and performers tables should contain the names and birth years of each person.
Once the database is built and filled with some data, you are going to want to ask questions about the data using SELECT statements of various sorts. To answer the question "list all the movies directed by Billy Wilder," for example, you will need some kind of connection between movies and directors. You might be tempted to introduce a director_id field into the movies table, but you'll get in trouble with any movie directed by more than one person (the Coen brothers, for example). Instead, you should create a table named something like directed_by or director_movie_links, each of whose rows contains a director ID and a movie ID. For example, your table might include one row with Joel Coen's director ID and the movie ID for "Fargo," and another row for Ethan Coen's director ID and the movie ID for "Fargo." This setup allows you to have movies with multiple directors, as well as directors with multiple movies. You will want to use a similar table to show the connections between performers and movies.
Your database should include at least ten movies, ten performers, and five directors.
There are many on-line resources for the movie-related data you will need for this assignment, the best known of which is probably the Internet Movie Database.
Once you have built your database and added data, hand in screen shots containing the following items. For items 3 and above, include the SQL query that produced it.
A list of all your tables.
The full contents of each table.
For some director (pick one), a list of the movies he/she directed (according to your database, that is--no need to include all sixty-seven Hitchcock). This list should be ordered by year.
For some performer, a list of the movies he/she acted in, ordered by movie title.
For some movie, a list of the performers in the movie, alphabetized by last name.
For some director, a list of the performers who acted in the director's movies, alphabetized by last name.
A list of performers who acted in movies released before 1970. Include the movies and the years, and order the list by year. Note that a performer might appear in this list many times (for example, Ingrid Bergman in "Casablanca," "Notorious," and "Murder on the Orient Express"), and a movie might also appear many times (Ingrid Berman, Peter Lorre, and Humphrey Bogart in "Casablanca").
A list of movies directed by directors born after 1950, alphabetized by movie title.
Any other interesting list of your own choice.
You might want some SQL tutorial information or reference material.
Some
possibilities include the W3 Schools
SQL Tutorial, the tutorial
at mysql.com, and the
MySQL
reference page. Remember that Simple SQL is somewhat limited,
though, so some of the commands you come across may not be implemented.
Good luck!