1.select 列 from 表列表名/视图列表名 where 条件.
2.select 列 from 表列表名/视图列表名 where 条件 group by (列列表) having 条件
3.select 列 from 表列表名/视图列表名 where 条件 group by (列列表) having 条件 order by 列列表
4.select 列 from 表1 join 表2 on 表1.列1=表2.列1...join 表n on 表n.列1=表(n-1).列1 where 表1.条件 and 表2.条件...表n.条件
执行顺序:
- 先where 后select
- 先where 再group 再having 后select
- 先where 再group 再having 再select 后order
- 先join 再where 后select
DDL
CREATE,ALTER,DROP,RENAME,TRUNCATE,COMMENT
DCL
GRANT--授权,REVOKE--取消授权