-- 创建 cattleprovince 表
-- 请在数据库中执行此SQL语句

USE cattleTends;

-- 创建省份数据表
CREATE TABLE IF NOT EXISTS cattleprovince (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
    province VARCHAR(255) NOT NULL UNIQUE COMMENT '省份名称',
    province_price DECIMAL(10, 2) COMMENT '省份均价',
    inventory_23th INT COMMENT '23年存栏（万头）',
    slaughter_23th INT COMMENT '23年出栏（万头）',
    inventory_24th INT COMMENT '24年存栏（万头）',
    slaughter_24th INT COMMENT '24年出栏（万头）',
    inventory_25th INT COMMENT '25年存栏（万头）',
    slaughter_25th INT COMMENT '25年出栏（万头）',
    create_time DATETIME COMMENT '创建时间',
    up_time DATETIME NOT NULL COMMENT '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='省份数据表';

-- 为 cattleprovince 表添加索引
CREATE INDEX idx_province_name ON cattleprovince(province);
CREATE INDEX idx_province_price ON cattleprovince(province_price);
CREATE INDEX idx_inv_23 ON cattleprovince(inventory_23th);
CREATE INDEX idx_sla_23 ON cattleprovince(slaughter_23th);
CREATE INDEX idx_inv_24 ON cattleprovince(inventory_24th);
CREATE INDEX idx_sla_24 ON cattleprovince(slaughter_24th);
CREATE INDEX idx_inv_25 ON cattleprovince(inventory_25th);
CREATE INDEX idx_sla_25 ON cattleprovince(slaughter_25th);

