mysql 标准创建表语句create table
sql代码:
建表:create table;
-- 目标表表结构
drop table if exists tmp_dim_shop_info_daily;
CREATE TABLE if not exists tmp_dim_shop_info_daily(
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`date_id` varchar(50) COMMENT ‘数据日期‘,
`warehouse_code` varchar(50) default null COMMENT ‘大仓编码‘,
`warehouse_name` varchar(50) default null COMMENT ‘大区‘,
`city_name` varchar(50) COMMENT ‘城市‘,
`shop_code` varchar(50) COMMENT ‘点位编码‘,
`shop_name` varchar(50) COMMENT ‘点位名称‘,
`shop_status` int(11) COMMENT ‘点位状态 1:启用/运营;0其他状态‘,
`station_warehouse_code` varchar(50) COMMENT ‘微仓编码‘,
`station_warehouse_name` varchar(50) COMMENT ‘微仓地址‘,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘更新时间‘,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间‘,
PRIMARY KEY `pk_id` (`id`),
KEY `idx_date_id` (`shop_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=‘点位微仓维度表‘;