AccessionSQL, one case at a time
#013Level 2 of 6 · Scenario 3: The Conservation Budget

How long a treatment takes

Scenario 3 · The Conservation Budget

The lab is being asked to forecast next year, and a forecast needs a typical job as well as a total. Finance also wants to see the spread — the quickest thing you did and the longest.

Schema · 1 table
treatments
  • idpkINTEGER
  • object_titleVARCHAR
  • wingVARCHAR
  • treatment_typeVARCHAR
  • conservatorVARCHAR
  • started_onDATE
  • hoursDOUBLE
  • costDOUBLE

Toolkit

SELECT
Choose which columns come back.
FROM
Specify which table to read.
WHERE
Filter rows by a condition.
ORDER BY
Sort the results by a column.
DESC
Reverse the sort: largest or latest first.
AVG
The mean of a numeric column.
MIN
The smallest value in a column.
MAX
The largest value in a column.
Objective

Return one row with the average, minimum and maximum hours across all treatments.

Your query

starting DuckDB…
loading editor…

Results

No result yet.