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
Movies
MovieSupplier
Orders
OrderID |
SupplierID |
MovieID |
Copies |
Rentals
CustomerID |
TapeID |
CkoutDate |
Duration |
Suppliers
Specifications for the database are as follows:
- 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.
- There is a collection of suppliers from which the store can order described by
Suppliers.
- 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.
- The store can place an order for one or more movies with one of its suppliers. This
information is kept in the Orders relation.
- 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.
- The store tracks its customers with the Customers relation.
- 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