London, or as the Romans called it "Londonium"! Home to over 8.5 million residents who speak over 300 languages. While the City of London is a little over one square mile (hence its nickname "The Square Mile"), Greater London has grown to encompass 32 boroughs spanning a total area of 606 square miles!
Given the city's roads were originally designed for horse and cart, this area and population growth has required the development of an efficient public transport system! Since the year 2000, this has been through the local government body called Transport for London, or TfL, which is managed by the London Mayor's office. Their remit covers the London Underground, Overground, Docklands Light Railway (DLR), buses, trams, river services (clipper and Emirates Airline cable car), roads, and even taxis.
The Mayor of London's office make their data available to the public here. In this project, you will work with a slightly modified version of a dataset containing information about public transport journey volume by transport type.
The data has been loaded into an AWS Redshift database called
tfl with a single table called
journeys, including the following data:
|Month in number format, e.g., |
|Number of days in the given month|
|Date that the data was reported|
|Method of transport used|
|Millions of journeys, measured in decimals|
You will execute SQL queries to answer three questions, as listed in the instructions.
-- most_popular_transport_types SELECT journey_type, SUM(journeys_millions) AS total_journeys_millions FROM tfl.journeys GROUP BY journey_type ORDER BY 2 DESC;
-- emirates_airline_popularity SELECT month, year, ROUND(SUM(journeys_millions), 2) AS rounded_journeys_millions FROM tfl.journeys WHERE journey_type = 'Emirates Airline' AND journeys_millions IS NOT NULL GROUP BY month, year ORDER BY 3 DESC LIMIT 5;
-- least_popular_years_tube SELECT year, journey_type, ROUND(SUM(journeys_millions), 2) AS total_journeys_millions FROM tfl.journeys WHERE journey_type = 'Underground & DLR' AND journeys_millions IS NOT NULL GROUP BY year,journey_type ORDER BY 3 LIMIT 5;