-- 为 cattleprovince 表添加全国总量字段
-- 请在数据库中执行此SQL语句

USE cattleTends;

-- 添加6个全国总量字段
ALTER TABLE cattleprovince
    ADD COLUMN national_inventory_23th INT COMMENT '23年全国存栏量（15个省份存栏量的总和）',
    ADD COLUMN national_slaughter_23th INT COMMENT '23年全国出栏量（15个省份出栏量的总和）',
    ADD COLUMN national_inventory_24th INT COMMENT '24年全国存栏量（15个省份存栏量的总和）',
    ADD COLUMN national_slaughter_24th INT COMMENT '24年全国出栏量（15个省份出栏量的总和）',
    ADD COLUMN national_inventory_25th INT COMMENT '25年全国存栏量（15个省份存栏量的总和）',
    ADD COLUMN national_slaughter_25th INT COMMENT '25年全国出栏量（15个省份出栏量的总和）';

-- 为全国总量字段添加索引
CREATE INDEX idx_national_inv_23 ON cattleprovince(national_inventory_23th);
CREATE INDEX idx_national_sla_23 ON cattleprovince(national_slaughter_23th);
CREATE INDEX idx_national_inv_24 ON cattleprovince(national_inventory_24th);
CREATE INDEX idx_national_sla_24 ON cattleprovince(national_slaughter_24th);
CREATE INDEX idx_national_inv_25 ON cattleprovince(national_inventory_25th);
CREATE INDEX idx_national_sla_25 ON cattleprovince(national_slaughter_25th);

