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.
- List the site ID, date, region, description, and altitude of all samples, in date order.
- List all samples that were gathered at an altitude of between 0 and 100 metres. (Hint: This should look familiar. Can you re-use something you’ve already done?)
- List the names (in alphabetical order) of scientists who have gathered samples in the Dunedin region.
- Output full details of all samples, including the scientist and the site.
- List the names (in alphabetical order) of scientists who haven’t yet gathered a sample. (Hint: You’ll need to use an outer join. Remember that unmatched columns are filled with nulls.)