MySQL常用语句

1.查看mysql的数据库列表

show databases;

2.使用某个库

use [数据库名];

3.查看表列表

show tables;

4.新建一个数据库

create database 库名;

5.建表

create table 表名(数据名);

6.查看表

select * from表名;

7.查询特定列

select 列名 from 表名;

8.查询数据并进行过滤

select * from 表名 where 条件;

9.插入数据

insert into 表名(列名称) values('', '');

10.修改表

update 表名 set 列名='值' where 条件;

11.删除表中的记录

delete from 表名 where 条件;

12.删除表

drop table 表名;

 

 

注意事项:

1.create一定不要写成creat

2.结尾一定要加上分号

3.熟练掌握这些命令后,可以尝试使用数据库的可视化界面。如SQLyog

 

posted @ 2020-11-06 09:48  Gazikel  阅读(62)  评论(0编辑  收藏  举报