SQL是哪几个单词的首字母
Structured Query Language(结构化查询语言)
有结构的 疑问 语言
1.创建/删除数据库与表单
创建数据库的SQL语句
create datebase 数据库名
删除数据库的SQL语句
drop database 数据库名
创建新表的SQL语句
create table 表名(id int primary key auto_increment,name varchar(20))
删除表的SQL语句
drop table 表名
2.表单内增删改查
插入数据的SQL语句
insert into 表名(name) values(TOM)
删除数据的SQL语句
delete from 表名 where 条件
更改数据的SQL语句
update 表名 set name=KK where 条件
查询数据的SQL语句
select * from 表名 where 条件
分组查询语句
select * from 表名 group by 条件
分页查询语句
select * from 表名 limit a,b (例:现在要查第5页第8条数据,那么a=5*8-8=32 ;b=8)
排序查询语句
select * from 表名 where 条件 order by 表名[asc:升序,desc:降序]
查询总数.求和.平均.最大.最小的SQL语句
1)总数:select count(*) from 表名
2)求和:select sum(sql) from 表名
3)平均:select avg(sql) from 表名
4)最大:select max(sql) from 表名
5)最小:select min(sql) from 表名