Database Reference
In-Depth Information
leading authority on the subject. On their site, I found a table of data that's publicly avail-
able. I loaded the table into the rookery database on my server and named it cor-
nell_birds_families_orders . Here's how the table is structured and how the
data looks:
DESCRIBE cornell_birds_families_orders;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra
|
+-------------+--------------+------+-----+---------+----------------+
| fid | int(11) | NO | PRI | NULL | auto_increment
|
| bird_family | varchar(255) | YES | | NULL |
|
| examples | varchar(255) | YES | | NULL |
|
| bird_order | varchar(255) | YES | | NULL |
|
+-------------+--------------+------+-----+---------+----------------+
SELECT * FROM cornell_birds_families_orders
LIMIT 1;
+-----+---------------+----------+------------------+
| fid | bird_family | examples | bird_order |
+-----+---------------+----------+------------------+
| 1 | Struthionidae | Ostrich | Struthioniformes |
+-----+---------------+----------+------------------+
This is useful. I can take the family names, use the examples for the brief description, and
use them both to finish the data in the bird_families table. I don't need their identi-
fication number (i.e., fid ) for each bird family — I'll use my own. What I need is a way
to match the value of the bird_order column in this table to the scientific_name
in the bird_orders table so that I can put the correct order_id in the
bird_families table.
There are a couple of ways I could do that. For now, I'll add another column to my
bird_families table to take in the bird_order column from this table from Cor-
nell. I'll use the ALTER TABLE statement, as described in Chapter5 , and enter the fol-
lowing on my server:
ALTER TABLE bird_families
ADD COLUMN cornell_bird_order VARCHAR ( 255 );
Search WWH ::




Custom Search