1. AUSTRALIAN BIRDS
BASIC SELECTS, SORTING, CRITERIA, OR, AND,
SPECIAL OPERATORS
Create and save SQL queries for the following:
1. Display the common names and Latin names of all birds.
2. Display the common names of birds that are active only during the day.
3. Display all of the different food types (with no duplicates).
4. Display the common names and sizes (centimetres) of birds with
nesting type ‘scrape’ ordered descending by centimetres.
5. Display the common names and activity type for all birds that are active
in the Day or during Dawn to Dusk. Order alphabetically.
6. Change the previous query so that it shows all of the Day birds first and
the Dawn to Dusk birds second. Sort the birds alphabetically within
these categories.
7. Display the common name and habitat of all birds that do NOT have
the habitat ‘Wet Areas’.
8. Display the common name and description of all birds in the family
Megapodiidae.
9. Display the common name and habitat of all birds that are Predators
and live in Grassland.
10. Display the common name and size in centimetres of all birds with a
habitat of Ground Hole and a size less than 50cm.
11. Display the bird families containing birds that are scavengers or
vegetarians. Do not show duplicates.
12. Display the common name and size of all birds between 30cm and
60cm. Order by size first (lowest to highest), then common name
(alphabetical).
13. Display the common name and size of all birds NOT between 40cm
and 50cm. Order as in the previous question.
14. Display the common name and nesting type of all birds that do NOT
have the nesting types “Platform” or “Mound”.
2. WILDCARDS, CALCULATED FIELDS, GROUPING
15. Display the Common Name and Latin Name of all birds with the Latin
Name starting with ‘Coturnix’.
16. Display the Common Name and Habitat of all birds with ‘quail’ in their
name. Sort alphabetically by common name.
17. Display the Common Name and Centimetres of all birds between 10
and 19 cm. Order by size (ascending).
18. Display the Common Name and Centimetres of all birds between 60
and 65 cm. Order by size (ascending).
19. Use a wildcard to display the different Nesting types that include the
word ‘cup’. Show no duplicates.
20. Display all of the nesting types that do NOT contain the word ‘scrape’.
21. Display the overall average centimetres for all birds. Use the column
heading “Average Bird Size”.
22. Modify the previous query so that the average is displayed with “cm”
concatenated to it. (HINT: Use the & operator).
23. Display the largest bird size in each family. (HINT: use GROUP BY).
Name the size column ‘Largest Size’.
24. Display the smallest bird size in each family beginning with ‘P’. Name
the size column ‘Smallest Size’. Order the results from smallest to
largest.
25. Modify the previous query so that it only covers birds that are
predators.
26. Display the average bird size for each food type where the average
size is less than 60. Use appropriate column names.
27. For every Nesting type, display the Family that appears first
alphabetically. (HINT: You can use ‘min’ on text).
28. For every Nesting type, display the number of birds. (HINT: use the
‘count’ function).
29. Display the number of families overall.
30. Display the number of families with the habitat “Wet Area”.
31. Count the number of Dawn to Dusk birds in the Hirundinidae family.
3. 32. For each Activity type, show the number of families that number
greater than 100.
33. Show the number of Food types that have the second letter ‘n’.