1.关于数据库的sql(增、删、查):
① create database dbName character set utf8;
②drop database dbName;
③show databases;
show create database dbName;
2.关于表sql(增、删、改、查)
①creat table tableName(id int primary key auto_increament,name varchar(20)) charset=utf8 engine=innodb;
insert into tableName values(),();
②drop table tableName;
thuncate table tableName;
③update tableName set ..........;
rename tableName to NewTableName;
alter table tableName charset=utf8/gbk engine=innodb/myisam;
④select * from tableName;
desc tableName;
show tables;
show create table tableName;
3.关于表sql字段(增、删、改)
①alter table tableName add 字段名称 字段类型 first/after 别的字段
②alter table tableName drop 字段名称;
③alter table tableName change 原字段名 新字段名 字段类型;(修改字段名和类型)
alter table tableName modify 字段名 字段类型 first/after 别的字段;(修改类型和位置)
4.SQL分类
①DDL :Data Definition language :create,drop,alter,truncate(不支持事务)
②DML: Data Manipulation Language:insert,update,delete,select(支持事务)
③DQL: Data Query Language : select
④TCL: Transaction Control Language: begin、rollback、commit、savepoint s1、rollback to s1;
⑤DCL:Data Control Language:分配用户权限相关
下一篇:名词解释(注释、主键约束、主键+自增、数据冗余、truncate、事务、数据类型):https://blog.csdn.net/Struggle233/article/details/88923560