mysql基本常用命令

来源:互联网 发布:linux 路由metric 编辑:程序博客网 时间:2024/06/02 02:01
<span style="font-size:18px;"><strong>//mysql基本常用命令.txtcreate database 数据库;//创建数据库use 数据库;//使用数据库create table 数据表();//创建数据表show databases;//显示所有数据库show tables;//显示所有数据表insert into 数据表() values();//添加数据delete from 数据表 where id='';//删除数据update 数据表 set 字段=值 where id='';//更新数据select * from 数据表;//查询数据desc 数据表;//查看表结构show columns from 数据表;//查看表结构alter table 数据表 add column 字段 int;//增加一个字段alter table 数据表 drop column 字段;//删除一个字段alter table 数据表 add index 索引名(字段);//为一个字段添加索引alter table 数据表 drop index 索引名;//删除一个字段的索引 </strong></span>
0 0