Workspace
Mohamed Gaml/

Project: Analyzing Industry Carbon Emissions

0
Beta
Spinner

Photo by Maxim Tolchinskiy on Unsplash

When factoring heat generation required for the manufacturing and transportation of products, Greenhouse gas emissions attributable to products, from food to sneakers to appliances, make up more than 75% of global emissions. -The Carbon Catalogue

Our data, which is publicly available on nature.com, contains product carbon footprints (PCFs) for various companies. PCFs are the greenhouse gas emissions attributable to a given product, measured in CO2 (carbon dioxide equivalent).

This data is stored in a PostgreSQL database containing one table, prouduct_emissions, which looks at PCFs by product as well as the stage of production that these emissions occurred. Here's a snapshot of what product_emissions contains in each column:

product_emissions

fielddata type
idVARCHAR
yearINT
product_nameVARCHAR
companyVARCHAR
countryVARCHAR
industry_groupVARCHAR
weight_kgNUMERIC
carbon_footprint_pcfNUMERIC
upstream_percent_total_pcfVARCHAR
operations_percent_total_pcfVARCHAR
downstream_percent_total_pcfVARCHAR

You'll use this data to examine the carbon footprint of each industry in the dataset!

Unknown integration
DataFrameavailable as
carbon_emissions_by_industry
variable
-- Complete the query  
SELECT	industry_group,
       COUNT(DISTINCT pe.company) AS num_companies,
       ROUND(SUM(pe.carbon_footprint_pcf), 1) AS total_industry_footprint	   
FROM (SELECT
	  MAX(year) AS most_recent 
	 FROM product_emissions
	 ) AS af
JOIN product_emissions pe ON af.most_recent = pe.year
GROUP BY industry_group
ORDER BY total_industry_footprint desc;
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
  • AI Chat
  • Code