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

-- Mart: OFFICIAL DfE KS4 national headline averages — one row per academic
-- year (England, state-funded, all pupils), from the EES national dataset.
-- Replaces the previous unweighted school-level means, which were 7–15
-- points off every headline measure and produced an arithmetically
-- impossible national Progress 8. gcse_grade_91_pct has no official
-- national series and is NULL (schema kept for the API model).

select
    year,
    attainment_8_score,
    progress_8_score,
    english_maths_standard_pass_pct,
    english_maths_strong_pass_pct,
    ebacc_entry_pct,
    ebacc_standard_pass_pct,
    ebacc_strong_pass_pct,
    ebacc_avg_score,
    cast(null as double precision) as gcse_grade_91_pct
from {{ ref('stg_ees_ks4_national') }}
order by year
