July 2005
Intermediate to advanced
1032 pages
27h 10m
English
Now that you have seen how to connect to a database and issue a simple query, it's time to create some sample data to work with.
Because you are pretending to model a movie-rental business (that is, a video store), you will create tables that model the data that you might need in a video store. Start by creating three tables: tapes, customers, and rentals.
The tapes table is simple: For each videotape, you want to store the name of the movie, the duration, and a unique identifier (remember that you may have more than one copy of any given movie, so the movie name is not sufficient to uniquely identify a specific tape).
Here is the command you should use to create the tapes table:
CREATE TABLE tapes ( tape_id CHARACTER(8) UNIQUE, ...
Read now
Unlock full access