CS 330
Lecture 8
Examples
Nested queries
- Find names of all sailors who reserved all boats.
Aggregate functions
- Find average age of sailors.
- Find average age of sailors with a rating of 10.
- Find name and age of oldest sailor.
- Count number of sailors.
- Count number of distinct names in Sailors.
- Find names of sailors who are older than oldest sailor with a
rating of 10.
- Find age of the youngest sailor at each rating level.
- Find age of the youngest sailor older than 18, for each
rating level with at least two such sailors.
- For each red boat find the number of reservations for it.
- Find average age of sailors [older than 18] for each rating
level that has at least 2 sailors.
Ileana Streinu