有关志愿通的代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

32 lines
1.1 KiB

USE zhiyuantong;
SELECT
COUNT(*) AS total_schools,
COUNT(DISTINCT moe_school_code) AS unique_moe_codes,
COUNT(DISTINCT province_name) AS province_count,
SUM(education_level='本科') AS undergraduate_schools,
SUM(education_level='专科') AS vocational_colleges,
SUM(province_name='甘肃省') AS gansu_schools
FROM schools
WHERE school_status='active';
SELECT
SUM(moe_school_code NOT REGEXP '^[0-9]{10}$') AS invalid_moe_codes,
SUM(official_name IS NULL OR official_name='') AS missing_names,
SUM(province_name IS NULL OR province_name='') AS missing_provinces,
SUM(city_name IS NULL OR city_name='') AS missing_cities,
SUM(authority_name IS NULL OR authority_name='') AS missing_authorities,
SUM(education_level NOT IN ('本科','专科','成人高等教育')) AS invalid_levels
FROM schools
WHERE school_status='active';
SELECT ownership_type, COUNT(*) AS school_count
FROM schools
WHERE school_status='active'
GROUP BY ownership_type
ORDER BY school_count DESC;
SELECT dataset_year, status, rows_read, rows_inserted, rows_updated, rows_rejected
FROM ingestion_runs
ORDER BY started_at DESC
LIMIT 5;