|--需求说明
|--实现思路
对着语法直接撸
|--代码内容
#创建数据表,并实现对表的修改操作 create database `test`; #创建数据库 use `test`; #切换数据库 create table `preson`( `number` int(4) auto_increment primary key comment'序号', `name` varchar(50) not null comment'姓名', `sex` char(2) comment'性别', `birthday` datetime comment'出生日期' ); #创建数据表 alter table `preson` rename `tb_preason`; #更换表名 alter table `tb_preason` add `birthday1` date comment'出生年月日'; #增加出生日期字段 alter table `tb_preason` change `number` `id` bigint primary key comment'序号'; #将number字段变更为id字段
|--运行结果