Average Aircraft Age by Airline

I’ve been doing some reporting on FlightStats, and produced an interesting report: What is the average age of the aircraft in active use by each airline?

Update: Due to bugs in data that Southwest is reporting, their average numbers are way off. I’ll get back on them.

+---------------------+---------+-------------------------+
| nickname            | avg_age | graph                   |
+---------------------+---------+-------------------------+
| Jetblue             |  3.2736 | ###                     |
| Hawaiian            |  3.9361 | ###                     |
| American Eagle      |  4.2526 | ####                    |
| ATA                 |  4.2690 | ####                    |
| Atlantic Coast      |  4.4526 | ####                    |
| Continental Express |  4.5238 | ####                    |
| Airtran             |  4.6742 | ####                    |
| Atlantic Southeast  |  5.2899 | #####                   |
| Comair              |  6.4736 | ######                  |
| Sky West            |  6.6019 | ######                  |
| Continental         |  9.2111 | #########               |
| Alaska              | 10.3416 | ##########              |
| United              | 11.2737 | ###########             |
| America West        | 12.2283 | ############            |
| USAir               | 13.3484 | #############           |
| Delta               | 13.9013 | #############           |
| American            | 18.3311 | ##################      |
| Northwest           | 20.6489 | ####################    |
| Southwest           | 23.6350 | ####################### |
+---------------------+---------+-------------------------+


P.S., The query to get that is:

SELECT
  carriers.nickname,
  avg(year(now())-aircraft.year_built) as avg_age,
  repeat("#", avg(year(now())-aircraft.year_built)) as graph
FROM ontime_3month
LEFT JOIN aircraft ON ontime_3month.tail_num=aircraft.tail_num
LEFT JOIN carriers ON carriers.code=ontime_3month.carrier 
WHERE aircraft.year_built > 0
GROUP BY carrier
ORDER BY avg_age

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s