mysql的基本使用(1)

一、数据库的增删改查

  1. 增:create database 库名;

mysql的基本使用(1)
2. 删:drop database 库名;mysql的基本使用(1)
3. 改:alter database 库名 charset=‘gbk’
mysql的基本使用(1)
4. 查:show database; 查看所有数据库
show create database 库名;查看一个
mysql的基本使用(1)

二、表的增删改查

1、切换库:use 库名;mysql的基本使用(1)
2、增:create table 表名(属性 属性类型,…)
mysql的基本使用(1)
3、改:alter table 表名 modify name char(6);
mysql的基本使用(1)
4、删:drop table b2;mysql的基本使用(1)
5、查:select * from tables;
select create table 表名;
describe b1;
mysql的基本使用(1)
mysql的基本使用(1)

三、表内数据的增删改查:

1、增加:inster into 表名 values(属性值,属性值,…)
insert into 表名 values(1,‘json’),(2,‘hello’),(3,‘world’).插入多条语句
mysql的基本使用(1)
2、删 :delete from 表名 where 条件
mysql的基本使用(1)
3、改: update 表名 set 属性=属性值 where 条件
mysql的基本使用(1)
4、查:select * from 表名;
select 表的属性 from表 where 条件;
mysql的基本使用(1)