Instruction
Jolly good! Let's do one more exercise before we move on.
Exercise
Find all aircraft that were launched before January 1, 2014 and took more than one flight. For each aircraft, show its ID (as Id) and calculate the average distance covered on all its routes. Name the column AvgDistance.
Stuck? Here's a hint!
- Use
AVG(x)to find the average value of x. - Remember about the proper date format and use quotes:
'YYYY-MM-DD'. - Use
HAVINGwithCOUNT(x)afterGROUP BYto satisfy the condition for more than 1 flight.



