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

What the year cost

Scenario 3 · The Conservation Budget

Budget review is Monday and the finance office wants the headline before it wants anything else: how much conservation work was done this year, how long it took, and what it cost.

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.
COUNT(*)
How many rows there are.
SUM
Add up a numeric column across all rows.
Objective

Return one row with three numbers: the number of treatments, the total hours, and the total cost.

Your query

starting DuckDB…
loading editor…

Results

No result yet.