Baselight
SELECT 
  CASE 
    WHEN LOWER("type") LIKE '%boeing%' THEN 'Boeing'
    WHEN LOWER("type") LIKE '%airbus%' THEN 'Airbus'
    WHEN LOWER("type") LIKE '%lockheed%' THEN 'Lockheed'
    WHEN LOWER("type") LIKE '%fairchild%' THEN 'Fairchild'
    WHEN LOWER("type") LIKE '%douglas%' THEN 'Douglas'
    WHEN LOWER("type") LIKE '%mcdonnel%' THEN 'McDonnel'
    WHEN LOWER("type") LIKE '%canadair%' THEN 'Canadair'
    ELSE 'Other'
  END as "Manufacturer",
  COUNT(*) as "Number of Crashes",
  AVG("aboard") as "Average aboard",
  AVG("ground") as "Average killed in ground",
  AVG("fatalities") as "Average Number of Fatalities",
  AVG("survivalrate") as "Survival Rate"
FROM 
  @kaggle.juancarlosventosa_large_passenger_plane_crashes_19332009.large_passenger_plane_crashes_1933_to_2009
GROUP BY 
  CASE 
    WHEN LOWER("type") LIKE '%boeing%' THEN 'Boeing'
    WHEN LOWER("type") LIKE '%airbus%' THEN 'Airbus'
    WHEN LOWER("type") LIKE '%lockheed%' THEN 'Lockheed'
    WHEN LOWER("type") LIKE '%fairchild%' THEN 'Fairchild'
    WHEN LOWER("type") LIKE '%douglas%' THEN 'Douglas'
    WHEN LOWER("type") LIKE '%mcdonnel%' THEN 'McDonnel'
    WHEN LOWER("type") LIKE '%canadair%' THEN 'Canadair'
    ELSE 'Other'
  END
ORDER BY 
  "Number of Crashes" DESC;
ManufacturerNumber of CrashesAverage aboardAverage killed in groundAverage Number of FatalitiesSurvival Rate
Boeing150152.6933333333333318.95333333333333399.813333333333330.30162190128000016
Other146108.89726027397261.157534246575342489.575342465753420.15560274076712327
Douglas90144.433333333333341.122222222222222283.333333333333330.35762248045555556
Lockheed35131.742857142857130.742857142857142994.742857142857150.18324848534285715
Airbus30189.533333333333330.966666666666666796.633333333333340.4655128034333333
McDonnel21210590.466993171
Fairchild2820820
Canadair1840720.142857143

Share link

Anyone who has the link will be able to view this.