数据库中表格管理

1、创建表

create table xxx (id int primary key not null auto_increment,name varchar(20));

红色为字段属性

2、查看表格属性

dessc 表名;

3、查看表格内容

select * from 表名;

4、查看创建的表格语法格式

show create table 表名;

5、删除表

drop table  表名

6、为表格增加字段(加一个属性)

alter table 表名 add birhday datetime;

其中birthday为表格的属性,datetime为birthday的类型

7、将birthday更改为birth

alter table 表名 change birthday birth datetime;

8、将datetime 更改为date

alter table 表名 modify birth date;

9、删除表格的某一属性

alter table 表名 drop birth;

10、查看表属性以及创建表格

11、在空表格添加信息

12、更改表格信息

update students set gender=2 where id=3;

 

13、删除表格信息

delete from students where id=2;

 

 

                       

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值