一、SQL...........................................................................................................................................................8
1.1、基本概念:...................................................................................................................................8
1.2、数据库安全:...............................................................................................................................8
1.3、基本的SQL SELECT 语句.............................................................................................................8
1.4、SELECT语句...................................................................................................................................9
1、语法:.......................................................................................................................................9
2、SQL语句说明:.........................................................................................................................9
3、数字和日期都可以使用数学运算符建立表达式。 ...............................................................9
4、定义空(NULL)值...................................................................................................................9
5、别名...........................................................................................................................................9
6、spool +路径...........................................................................................................................10
7、连接操作符: ||...................................................................................................................10
8、文本字符串.............................................................................................................................10
9、DISTINCT.................................................................................................................................10
1.5、SQLPLUS 与 SQL 的关系...........................................................................................................10
1、SQLPLUS命令的功能:...........................................................................................................10
2、查询 SQLPLUS 命令...............................................................................................................10
3、SQLPLUSW 在 WINDOWS 下运行的分析器。 .........................................................................10
4、SQLPLUS 命令: ..................................................................................................................... 11
1.6、单行函数.....................................................................................................................................12
1、character字符类型函数: ...................................................................................................12
2、number数字类型函数.............................................................................................................15
3、时间类型函数:(date) .......................................................................................................15
1.7、嵌套函数:..................................................................................................................................21
1. 通用函数:.......................................................................................................................21
2. 条件表达式:...................................................................................................................24
3. 从多表中显示数据: .......................................................................................................25
1.8、用字函数产生的总计.................................................................................................................26
1.9、子查询:.....................................................................................................................................28
2.0、替换变量:.................................................................................................................................29
1.&.................................................................................................................................................29
2.&&...............................................................................................................................................29
2.1.环境变量:...................................................................................................................................29
2.2 格式化命令:................................................................................................................................30
2.3 做脚本文件的过程:....................................................................................................................31
2.3 数据操作语句:............................................................................................................................31
1. 插入...................................................................................................................................31
2. 删除...................................................................................................................................31
3. 更新...................................................................................................................................31
4. MERGE语句.........................................................................................................................32
5. 事务(transaction): ...................................................................................................32
2.4 创建和管理表................................................................................................................................33
1、表(TABLE)基本的存储单位,由行和列组成。 ...............................................................33
2、方案:一个用户所有对象的命名集合。 .............................................................................34
3、CTAS(子查询建表):...........................................................................................................34
4、截取:.....................................................................................................................................35