-- Select randomly from tables.
SELECT * FROM runs LIMIT 5;
SELECT * FROM dbt_yxie.safety_pcp_debug_e_events LIMIT 5;
SELECT * FROM dbt_yxie.safety_pcp_debug_runs LIMIT 5;

-- Count runs.
SELECT count(*) FROM runs;
SELECT count(*) FROM runs WHERE tracking_category is not null;

-- Count number of events in each run.
SELECT meta_id, count(*) as event_count FROM dbt_yxie.safety_pcp_debug_e_events GROUP BY meta_id ORDER BY 2 DESC;
SELECT meta_id, event_type, count(*) FROM dbt_yxie.safety_pcp_debug_e_events GROUP BY 1,2 LIMIT 5;

-- Get information of runs.
SELECT hr_id, autonomous_miles, tracking_category FROM runs WHERE data_id in (SELECT run_id FROM dbt_yxie.safety_pcp_debug_runs);
