Thermodynamics Experiment Results
Beginner Mode

Scenario

You are a scientist running thermodynamics experiments, and you have two tables containing temperature and pressure readings indexed by experiment ID.

Task

Write a Snowflake SQL query that:

  1. Joins {{ ref("temperatures") }} with {{ ref("pressures") }} on experiment_id using an INNER JOIN (only experiments present in both tables should appear)
  2. Computes a column called result as temperature * pressure
  3. Returns experiment_id and result, sorted by experiment_id in ascending order

Schema

temperatures

Column Type Description
experiment_id Integer Unique identifier for the experiment
temperature Double Temperature reading in Kelvin

pressures

Column Type Description
experiment_id Integer Unique identifier for the experiment
pressure Double Pressure reading in atmospheres

Example

temperatures:

experiment_id temperature
1 300.0
2 350.0
3 400.0
4 275.0

pressures:

experiment_id pressure
1 1.2
3 2.5
5 0.8

Expected Output:

experiment_id result
1 360.0
3 1000.0

Note: Experiments 2 and 4 exist only in temperatures, and experiment 5 exists only in pressures. All three are excluded because they are not present in both tables.

Quick Solution

Code Environment

Sign in or try as guest to run your code.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →