首页
IT
登录
6mi
u
盘
搜
搜 索
IT
Mysql创建表实现主键自增并且初始值为1000
Mysql创建表实现主键自增并且初始值为1000
xiaoxiao
2021-04-15
50
具体sql语句为如下:
CREATE
TABLE
`seckill`
(
`seckill_id`
bigint(
20
)
NOT
NULL
AUTO_INCREMENT comment
'商品库存id'
,
`name`
varchar
(
120
)
NOT
NULL
comment
'商品名称'
,
`number`
int
(
11
)
NOT
NULL
comment
'库存数量'
,
`start_time`
timestamp
NOT
NULL
comment
'秒杀开启时间'
,
`end_time`
timestamp
NOT
NULL
comment
'秒杀结束时间'
,
`create_time`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
on
update
CURRENT_TIMESTAMP
comment
'创建时间'
,
PRIMARY
KEY
(
`seckill_id`
),
KEY
`idx_start_time`
(
`start_time`
),
KEY
`idx_end_time`
(
`end_time`
),
KEY
`idx_create_time`
(
`create_time`
) ) ENGINE=InnoDB
DEFAULT
CHARSET=utf8 AUTO_INCREMENT=
1000
comment
'秒杀库存表'
;
转载请注明原文地址: https://ju.6miu.com/read-671067.html
技术
最新回复
(
0
)