这里写一个mysql的建表样例。
create table if not exists app_fund_index_percnet_df (
id int not null comment '主键id',
flag varchar(30) not null default '-' comment '数据标识',
index_name varchar(30) not null default '-' comment '指数名称',
close_price_min double default 0 comment '收盘价格-最小值',
close_price_percent10 double default 0 comment '收盘价格-10分位值',
close_price_percent20 double default 0 comment '收盘价格-20分位值',
close_price_percent30 double default 0 comment '收盘价格-30分位值',
close_price_percent40 double default 0 comment '收盘价格-40分位值',
close_price_percent50 double default 0 comment '收盘价格-50分位值',
close_price_percent60 double default 0 comment '收盘价格-60分位值',
close_price_percent70 double default 0 comment '收盘价格-70分位值',
close_price_percent80 double default 0 comment '收盘价格-80分位值',
close_price_percent90 double default 0 comment '收盘价格-90分位值',
close_price_max double default 0 comment '收盘价格-最大值',
busi_date varchar(10) comment '收盘日期',
close_price double comment '收盘价格',
create_time datetime not null default current_timestamp comment '创建时间',
update_time datetime not null default current_timestamp on update current_timestamp comment '更新时间',
-- 主键约束(可单字段或联合主键)
PRIMARY KEY (id),
-- 唯一约束(可选)
UNIQUE KEY uk_flag_index (flag, index_name),
-- 普通索引(可选,优化查询)
INDEX idx_indx (index_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指数分位数';
评论