Each warehouse table has a freshness SLA in etl_freshness_sla (table_name, max_lag_hours): its newest successful load must be no more than that many hours old. Every load attempt is logged in etl_load_log (load_id, table_name, loaded_at, status), where status is 'success', 'failed' or 'running'. Only 'success' loads count.
It is now 2024-06-10 12:00:00 (UTC). Return every table in etl_freshness_sla that is stale: its last successful load is more than max_lag_hours hours before now, or it has never loaded successfully. Tables without an SLA aren't checked.
Columns: table_name, last_success (its latest successful loaded_at, NULL if none), hours_since (hours from last_success to now, rounded to 1 decimal place; NULL if none). Sort by table_name.