December 2002
Intermediate to advanced
496 pages
9h 40m
English
In the world of relational databases, data often has complex relationships and is spread across multiple tables. Sometimes it is necessary to grab information from one table based on information in another. This requires that the two tables be JOINed.
For an example, we create a new table in the people database called addresses that contains information about people’s addresses (surprise!). First, it must be created as follows:
mysql> CREATE TABLE addresses ( -> lastname CHAR(20), -> firstname CHAR(20), -> address CHAR(40), -> city CHAR(20), -> state CHAR(2), -> zip CHAR(10) -> );
The table needs some data:
mysql> INSERT INTO addresses -> (lastname, firstname, address, city, state, zip) -> VALUES ("Wall", "Larry", "Number ...
Read now
Unlock full access