导图社区 SQL语言
数据定义语句、基本表的定义、create table <表名>、基本表的修改、alter table <表名>、基本表的删除、drop table <表名>
社区模板帮助中心,点此进入>>
论语孔子简单思维导图
《傅雷家书》思维导图
《童年》读书笔记
《茶馆》思维导图
《朝花夕拾》篇目思维导图
《昆虫记》思维导图
《安徒生童话》思维导图
《鲁滨逊漂流记》读书笔记
《这样读书就够了》读书笔记
妈妈必读:一张0-1岁孩子认知发展的精确时间表
SQL语言
数据定义语句
基本表的定义
create table <表名>
基本表的修改
alter table <表名>
增add
减drop
改alter
基本表的删除
drop table <表名>
查询
select 列名 from 表名 where 条件
单表查询
指定列
select<列名> from <表名>
所有列
select * from <表名>
消除所有取值相同的行
select distinct <行名> from <表名>
满足条件
比较大小
> < =
确定范围
(not) between ...and...
确定集合
(not)in()
字符匹配
select from where 列名 like ...
涉及空值
(不)空:where is (not)null
多重条件
and,or
排序
order by <列名>[ASC|DESC]
ASC升序
DESC降序
TOP子句
select top <列名>
top n子句
输出前面n条记录
top n percent子句
占比
聚集函数
count,sum,avg,max,min
分组
group by<列> having <条件>
连接查询
嵌套查询
in()
<>=
any/all 某个/所有
exists 存在
集合查询
并
union
交
intersect
差
except
数据更新
插入insert
insert into 表名 values(常量1,常量2), (常量1,常量2)
修改update
update 表名 set列名=表达式 where条件
删除delete
delete from 表名 where 条件
视图
定义
create view 视图名 as子查询 with check option
删除
drop view 视图名