SQLSQL LabPostgreSQL practice
00:0032 / 45
W07Advancedwindow frames · AVG

Three-run moving average

For telemetry pipeline runs, return run_id, started_at, records_in, and moving_avg_records_in, rounded to one decimal across the current and previous two telemetry runs. Sort chronologically.

Data available

Use this table

1 table
Table 1

pipeline_runs

Data ingestion jobs from four upstream sources.

  • run_idintegerPK
  • customer_idintegerFK
  • source_nametext
  • statustext
  • started_attimestamptz
  • completed_attimestamptzNULL
  • records_ininteger
  • records_outintegerNULL
Query editor

PostgreSQL

Run query
Result stream

Output

Run your query to inspect its result.
Contextual coach

Ask about this attempt

Run or check a query first. The coach only comments on a real error or grader mismatch.

Field notes

Hints & explanation

Try to solve it cold. Two progressive hints are available.