Skip to content

Populating your tables

Next week you will look in detail at data maintenance issues; however, to test the database you have just created, you will need some test data. Download the script species_data.sql and save it to your script directory. Feel free to look at the contents, but you should not have to change anything. The script inserts sighting details for the following observers, species and locations. Note that the tables below are not intended to correspond to your table structure.

Observers

first_name surname
James Smith
Anne Jones
Andrew Brown
Sarah Green
Gordon Stewart
Barbara Bruce

Species

family genus species common_name
rhinocerotidae diceros bicornis Black rhinoceros
hominidae pan troglodytes Common chimpanzee
felidae panthera uncia Snow leopard
ursidae ailuropoda melanoleuca Giant panda
canidae canis rufus Red wolf
pteropodidae epomops franqueti Franquet's epauletted fruit bat

Locations

continent country region
Africa Namibia Etosha Pan
Africa Uganda Kanungu
Asia Tajikistan Gorno-Badakhshan
North America Canada Ontario
Asia China Qinghai
Asia China Yunnan

Run the script in SQL Developer. If you any of your columns are too small to fit the data you will see the message ORA-12899: value too large for column. In such cases, alter your schema creation script and re-run it to update the table definitions, and then re-run species_data.sql to insert the data.

If you see any other errors, try to work out what the problem is, or ask for help.

Notice that one of the species names contains an apostrophe. Normally a single quote marks the beginning or the end of a text string - locate the corresponding insert statement in the file to see how this error is avoided.