labs / tiddlers / content / labs / lab05 / _Labs_05_Task 1_ Select

Write SQL SELECT statements to answer the following questions. Make sure you save your code somewhere for future reference. Note that an empty query result may not necessarily indicate an error. If you find there are no data in your schema that satisfy a query, insert some that do and try again.

  1. List all sites in order of region and description.
  2. List all samples that have comments, in reverse date order. (Hint: Look at the IS NULL operator.)
  3. List the site ID, region, description, latitude and longitude of sites whose altitude is between 0 and 100 metres. Save this query as a view called Low_Altitude_Sites.
    What happens to sites that have no (i.e., null) altitude, and why?

  4. Find the mobile phone numbers of scientists Terry Towel and Jane Smith (using their name, not ID!).