Database Reference
In-Depth Information
col10:
col12:
col13:
col14:
col15:
col16:
col17:
The LOAD DATA INFILE statement seems to be working well. It has inserted the fields
correctly into the columns of the table. The first row, though, contains the field names. We
don't need that row, but it won't affect anything for our scenario. Looking at the second
row, you can see that the data we want from the text file went into the right columns: we
have the scientific and common name of the birds, as well as the name of the order and
family to which they belong. For the fields that we don't want, the columns with generic
names have no value. That's fine. As I said before, there is a more professional, cleaner
way in which we could have loaded the data. We'll cover that method later. Let's proceed
with the next step to add newspecies to the birds table.
Checking the Accuracy of the Import
Before inserting data intothe birds table, let's check a little more closely the accuracy
of the data loaded into the clements_list_import table. We'll use the SELECT
statement to see how the data looks for the rows we want, the new species. Enter the fol-
lowing SQL statement on your server and review the results:
SELECT id, change_type,
scientific_name, english_name,
`order`, family
FROM rookery.clements_list_import
WHERE change_type = 'new species' LIMIT 2 \G
*************************** 1. row ***************************
id: 4073
change_type: new species
scientific_name: species
english_name: Prosobonia ellisi
order: extinct; formerly Moorea (Society Islands)
family: Charadriiformes
*************************** 2. row ***************************
id: 6707
change_type: new species
scientific_name: from the Arabian Peninsula
english_name: with range ""central Al Hajar mountains
order: species
family: Strix omanensis
Search WWH ::




Custom Search