--1 writing basic sql select statements
基于orcle 9i的标准查询语句:
A.数据查询语句 即SELECT 语句
B.DDL语句即,数据定义语句,包括数据对象的建立修改删除等的Command
C,数据操作语句,数据操作语句是在oracle环境里面实现对数据操作的command包括
update,insert,delete
D. DCL Command 数据控制语句,用来实现用户的授权及取消
E. TCL Command事务控制语句,包括commit,rollback,set point command
---writing sql statements
1.select 语句不区分大小写
2.select 可以写到一行or 多行,但是关键字不能跨行,也不可以被拆分
3.为提高程序的可读性则采用换行或缩进的格式书写
---column heading defaults
isql*plus
缺省得栏位头的对齐方式居中,同时这些头都是大写的
SQL*Plus
字符和日期的栏位居左,而数据的栏位居右。同时这些头也都是大写的
---defining a null value
A.A null is a value that is unavailable,unassigned,unknown,or inapplicable.
是一种不确定的状态
B.A null is not the same as zero or a blank space.
---null values in arithmetic expressions(空值参加到运算表达式里的时候)
arithmetic expressions containing a null value evaluate to null结果还是空
---如果要将前面所说的查询结果的头由大写改成任意形式的话要用双引号来实现
EXP:
select emp "Emp" from scott.emp;
oracle 实现字符串连接的时候采用的是“||"而sql server则采用的是"+"号
---literal character strings(连接字符串)
A.a literal is a character, a number, or a date included in the select list
B.Date and character literal values must be enclised within single
quotation marcks(单引号)
C.each character string is output once for each row returned
exp
sql>select emp,'''s name is ',name||' '||enname from scott.emp;
怎样进入isql*plus
待续
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/202861/viewspace-796724/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/202861/viewspace-796724/
本文围绕基于Oracle 9i的SQL语句展开,介绍了标准查询语句,包括数据查询、定义、操作、控制和事务控制语句;说明了SELECT语句书写规范,如不区分大小写等;还提及栏位头对齐方式、空值定义及运算结果,以及字符串连接等内容。
4706

被折叠的 条评论
为什么被折叠?



