{{ config(materialized='table') }}

-- Mart: Official DfE KS2 national headline averages — one row per academic year.
-- These are the published England-wide figures, not computed means from our school dataset.
-- Used by the /api/national-averages endpoint to provide accurate per-year reference lines
-- on the school history chart and for hero stat comparisons.

select
    year,
    rwm_expected_pct,
    rwm_high_pct,
    reading_expected_pct,
    reading_high_pct,
    reading_avg_score,
    writing_expected_pct,
    writing_gd_pct,
    maths_expected_pct,
    maths_high_pct,
    maths_avg_score,
    gps_expected_pct,
    gps_high_pct,
    gps_avg_score,
    science_expected_pct
from {{ ref('stg_ees_ks2_national') }}
order by year
