Database Reference
In-Depth Information
Let's see how effective the INSERT INTO...SELECT statement was. Execute the fol-
lowing on your server:
SELECT birds_new.scientific_name,
common_name, family_id,
bird_families.scientific_name AS family
FROM birds_new
JOIN bird_families USING(family_id);
+------------------------+---------------------+-----------+---------------+
| scientific_name | common_name | family_id |
family |
+------------------------+---------------------+-----------+---------------+
| Prosobonia ellisi | Moorea Sandpiper | 164 |
Scolopacidae |
| Strix omanensis | Omani Owl | 178 |
Strigidae |
| Batrachostomus chaseni | Palawan Frogmouth | 180 |
Podargidae |
| Erythropitta yairocho | Sulu Pitta | 217 |
Pittidae |
| Cichlocolaptes maza... | Cryptic Treehunter | 223 |
Furnariidae |
| Pomarea nukuhivae | Nuku Hiva Monarch | 262 |
Monarchidae |
| Pomarea mira | Ua Pou Monarch | 262 |
Monarchidae |
| Pnoepyga mutica | Chinese Cupwing | 285 |
Pnoepygidae |
| Robsonius thompsoni | Sierra Madre Gro... | 290 |
Locustellidae |
| Zoothera atrigena | Bougainville Thrush | 303 |
Turdidae |
| Sporophila beltoni | Tropeiro Seedeater | 322 |
Thraupidae |
+------------------------+---------------------+-----------+---------------+
This looks good. It's shows all 11 new species and we're able to match them to the appro-
priate bird families. Now we need only run an INSERT INTO...SELECT to copy all of
this data into the birds table.
Although there are plenty of records in the CSV data text file, it wasn't too difficult to
load the data. There are smoother ways we could have loaded the data. And there are
some other clauses, subclauses, and options available for other situations. We'll look at all
of these in thenext few sections.
Search WWH ::




Custom Search