Database Reference
In-Depth Information
Exercises
Here are some exercises to get practice using the INSERT statement and a few others that
we covered in this chapter. So that these exercises won't be strictly mundane data entry, a
couple of them call for you to create some tables mentioned in this chapter. The practice of
creating tables will help you to understand data entry better. The process of entering data
will help you to become wiser when creating tables. Both inform each other.
1. In the exercises at the end of Chapter4 , you were asked to create a table called
birds_body_shapes . This table will be used for identifying birds. It will be
referenced from the birds table by way of the column called body_id . The
table is to contain descriptions of body shapes of birds, which is a key factor in
identifying birds: if it looks like a duck, walks like a duck, and quacks like a duck,
it may be a goose — but it's definitely not a hummingbird. Here is an initial list of
names for general shapes of birds:
Hummingbird
Long-Legged Wader
Marsh Hen
Owl
Perching Bird
Perching Water Bird
Pigeon
Raptor
Seabird
Shore Bird
Swallow
Tree Clinging
Waterfowl
Woodland Fowl
Construct an INSERT statement using the multiple-row syntax — not the emphat-
ic method — for inserting data into the birds_body_shapes table. You'll have
to set the body_id to a three-letter code. You decide on that, but you might base
it somewhat on the names of the shapes themselves (e.g., Marsh Hen might be
MHN and Owl might be simply OWL ). Just make sure each ID is unique. For the
Search WWH ::




Custom Search