Specifications for the Movie Database


The queries that you'll implement in SQL Server are based on a movies database. The database keeps track of the movies, customers, orders, and movie suppliers for a single movie rental store. The schema for the movie database is as follows:

Customers

CustID LastName FirstName

Inventory

TapeID MovieID

Movies

MovieID MovieName

MovieSupplier

SupplierID MovieID Price

Orders

OrderID SupplierID MovieID Copies

Rentals

CustomerID TapeID CkoutDate Duration

Suppliers

SupplierID SupplierName

Specifications for the database are as follows:

  1. There is a large collection of movies described by the Movies relation - conceptually, this refers to all the movies ever put on videocassette. Each is uniquely identified by the MovieID.
  2. There is a collection of suppliers from which the store can order described by Suppliers.
  3. The MovieSupplier relation describes all the movies a supplier has to sell. It also describes how much the supplier will charge for a copy of that movie.
  4. The store can place an order for one or more movies with one of its suppliers. This information is kept in the Orders relation.
  5. When an order from a supplier arrives, the movies are marked as being in inventory. The Inventory relation describes the current set of movies the movie rental store has to offer customers. The store uses a TapeID to uniquely distinguish the movies it has in inventory since it may have more than one copy of a movie.
  6. The store tracks its customers with the Customers relation.
  7. The Rentals relation tracks which movies from the stores inventory that a customer has ever rented. A movie has a checkout date and a rental period associated with it.

Forward to Writing, Testing, and Executing Queries

Back to Main Page