基本的操作
增加,创建,插入,insert
---------------
insert into 表名 (字段列表) values (与字段相对的值列表)
不一定要一次性插入所有字段,或者按照原始的字段顺序插入:

但是:
字段与值的数量一定要匹配:

特别的:
如果所有的值都按照字段的出现顺序都插入的话,可以省略字段列表部分!

注意:数值类型,不需要增加引号!而字符串类型都需要出现引号内!(但是数值 型,可以出现引号内)
1. insert into stu (id, name) values (1, 'itcast');
2. `insert into stu (id) values (2);`
3. `insert into stu (name) values ('-');`
4. `insert into stu (name, id) values ('php', 4);`
5.
6. `insert into stu (id) values (5, 'php1016');`
7.
8. `insert into stu values (6, 'han');`
9. `insert into stu values (7); //错误`
10. `insert into stu values ('zhong', 8); //错误`
查询,检索,选择,select
---------------
select 字段列表 from 表名 [where 条件表达式]
其中字段列表可以使用 \* 表示所有字段!

关于条件表达式,默认是没有,表示永远为真!
但是,很少出现没有条件的情况!

为了突出,应该所有的语句都有查询条件!即使没有条件,我也强制增加一个 where 1;

关于字段列表:
也应该够用就可以!

1. `select \* from stu;`
2.
3. `select \* from stu where id \> 5;`
4.
5. `select \* from stu where 1;`
6.
7. `select name from stu where 1;`
删除,delete
---------
delete from 表名 where 条件;
关于条件,可以省略。表示永远为真。

注意,删除是不可逆的。要避免没有条件的删除!
1. `delete from stu;`
2. `delete from stu where 1;`
3.
4. `delete from stu where id\>5;`
修改,更新,update
------------
update 表名 set 字段=新值, 字段n=新值n where 条件
关于条件,可以省略。表示永远为真。

1. `update stu set name='PHP' where id=4;`
create,show,alter,drop database/talbe
add,modify,change,drop column
insert , select, update, delete table\_name
1. `insert into stu (id, name) values (10, '传智博客');`
2.
3. `create table t1 (`
4. `name varchar(255) charset gbk`
5. `);`
6.
7.
8. `show variables like 'character\_set\_%';`
9.
10. `set character\_set\_client = gbk;`
11. `set character\_set\_results = gbk;`