Skip to main content

Exercise 4

Create Table for Aggregate Global Emissions and Temperatures

To analyze the relationship between global emissions and temperatures, you will perform an INNER JOIN between the results of two views: aggregate_global_emissions and aggregate_global_temperatures. This join will combine the data from both views based on the common "Year" column.

To create a table called aggregate_global_emissions_temperatures with the desired columns in the global_temperatures schema:

  1. Perform an INNER JOIN between the aggregate_global_emissions and aggregate_global_temperatures table on the "Year" column.
  2. Select the following columns from the joined data:
    • YEAR: Integer
    • TOTALEMISSIONS: Float
    • LANDAVERAGETEMPERATURE: Float
    • LANDMAXTEMPERATURE: Float
    • LANDMINTEMPERATURE: Float
    • LANDANDOCEANAVERAGETEMPERATURE: Float

Your output table, aggregate_global_emissions_temperatures , should have the above schema.

Sample Output

YEARTOTALEMISSIONSLANDAVERAGETEMPERATURELANDMAXTEMPERATURELANDMINTEMPERATURELANDANDOCEANAVERAGETEMPERATURE
199188534.5887629.1794166679.774-0.12915.598
200092645.1147589.2011666679.863-1.33315.610666667
note

In the SQL statement, the use of double quotes around the YEAR column name is necessary because it is a reserved keyword in Snowflake.

select "YEAR" FROM TABLE