12311k

Untitled

Mar 10th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. SELECT
  2. COUNT(flights.flight_id) as flights_amount,
  3. CASE WHEN model LIKE 'Airbus%' THEN 'Airbus'
  4. WHEN model LIKE 'Boeing%' THEN 'Boeing'
  5. ELSE 'other' END AS type_aircraft
  6. FROM
  7. aircrafts
  8. INNER JOIN
  9. flights
  10. ON
  11. flights.aircraft_code = aircrafts.aircraft_code
  12. WHERE
  13. CAST(flights.departure_time AS date) BETWEEN '2018-09-01' AND '2018-09-30'
  14. GROUP BY
  15. type_aircraft
Add Comment
Please, Sign In to add comment