July 2005
Intermediate to advanced
1032 pages
27h 10m
English
So far, all the queries that you've seen involve a single table. Most databases contain multiple tables and there are relationships between these tables. This sample database has an example:
movies=# \d rentals
Table "rentals"
Attribute | Type | Modifier
-------------+--------------+----------
tape_id | character(8) | not null
rental_date | date | not null
customer_id | integer | not null
Here's a description of the rentals table from earlier in this chapter:
“When a customer comes in to rent a tape, we will add a row to the rentals table to record the transaction. There are three pieces of information that we need to record for each rental: the tape_id, the customer_id, and the date that the rental occurred. Notice that ...
Read now
Unlock full access