BIT 275

Homework due Tuesday October 12, 2010

General Instructions:

Note: There is a bug in SQL Buddy (the software that we use to run queries at bit.dains.org) so that if two columns have the same name it will only show one of them. For example, if you tried to select the name column from the dog and city tables in the same query only one would show up because they have the same name. This is an SQL Buddy bug. To work around it you’ll need to make sure to use columns aliases (the “AS” clause).

  1. Get a list of all foster parents and their home phone numbers. This list should contain 3 columns: first name, last name and phone number. The list should contain everyone in the foster parents table even if they don’t have a work phone.
  2. The same as the last problem but add columns for the city and state they live in. Sort this list by city, then last name, then first name.
  3. Get a list of all foster parents and their home and work phones. This list should contain 4 columns: first name, last name, home phone, work phone. It should include everyone in the foster parents table even if they don’t have a work phone or a home phone.
  4. Get a list of all foster parents who are not currently fostering a dog. The list shoud contain just first and last names and be sorted by first name and then last name.