mysql基本类型之日期类型

mysql基础类型之日期相关类型

date			年月日
datetime		年月日时分秒
time			时分秒
year			 年份

实例:

#  补充 : comment '信息' 相当于注释给这个字段起个名字

创建表:
create table user(
    id int comment'编号',
    name varchar(32) comment '姓名',
    reg_time datetime comment '注册时间',
    birthday date comment '生日',
    game_time time comment '游戏时间',
    born_year year comment '年份'
);

添加数据:
insert into user values(1,'gary','2022-1-25 11:11:22','2022-1-11','8:11:11','2022');

posted @ 2022-01-25 20:39  JasonBorn  阅读(79)  评论(0编辑  收藏  举报