SQL-DDL

                        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        ​​​​​​​        

 

 

create table tmp(
    id int comment '编号',
    workno verchar(10) comment '工号',
    name verchar(10) comment '姓名',
    gender char(1) comment '性别',
    age tinyint unsigned comment '年龄',
    idcard char(18) comment '身份证',
    entryday data comment '入职时间'
) comment ‘员工表’;

 

 

 

drop table user;
create table user(
    id int comment '工号',
    name varchar(10) comment '姓名',
    age tinyint comment '年龄',
    idcard char(18) comment '身份证号',
    address varchar(20) comment '户籍地',
    entrydata date comment '入职时间'
);

insert into user (id, name, age, idcard, address, entrydata) VALUES
(1,'陈嘉颖',23,'440572200105012215','广东','2023-4-25'),
(2,'陈',20,'440572200105012215','广东','2023-4-25'),
(3,'嘉',21,'440572200105012215','广东','2023-4-23'),
(4,'颖',22,'440572200105012215','广东','2023-4-25'),
(5,'陈建锐',23,'440572200105012215','广东','2023-4-24');
select database() ;

alter table user add workno int comment '工号';
alter table user modify workno char(2);
alter table user change workno worknum char(10);

desc user;
show create table user;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值