ITPub博客

首页 > 数据库 > Oracle > Before Basic SQL

Before Basic SQL

原创 Oracle 作者:superman-chenzs 时间:2007-03-21 22:57:53 0 删除 编辑

SQL statements are not case sensitive

SQL statements can be on one or more lines

Keywords cannot be abbreviated or split across lines

[@more@]Clauses are usually placed on separate lines

Indents are used to enhance readability


------------------------------------------------------------------------------------------------------------------
Column Heading Defaults

1.iSQL*Plus
- Default heading justification:Center
- Default heading desplay:Uppercase

2.SQL*Plus
- Character and Date column headings are left-justified
- Number column headings are right-justified
- Default heading display:Uppercase

Displaying Table Structure:
DESC[RIBE] table_name;
DUAL is a dummy table you can use to view results from functions and calculations

------------------------------------------------------------------------------------------------------------------
Create expressions with number and date data by using arithmetic operators.
+ : Add
- : Subtract
* : Multiply
/ : Divide

Operator Precedence: * / + -
- Multiplication and division take priority over addition and subtraction
- Operators of the same priority are evaluated from left to right
- Parentheses are used to force prioritized evaluation and to clarify statements


------------------------------------------------------------------------------------------------------------------
Defining a Null Value
- A null is a value that is unavailable,unassigned,unknown,or inapplicable
- 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


------------------------------------------------------------------------------------------------------------------
Defining a Column Alias
A column alias:
- Renames a column heading
- Is useful with calculations
- Immediately follows the column name - there can also be the optional AS keyword between the column name and alias
- Requires double quotation marks if it contains spaces or special characters or is case sensitive


------------------------------------------------------------------------------------------------------------------
Concatenation Operator
- Concatenates columns or character strings to other columns
- Is represented by two vertical bars(||)
- Creates a resultant column that is a character expression


------------------------------------------------------------------------------------------------------------------
Literal Character Strings
- A literal is a character,a number,or a date included in the SELECT list
- Date and character literal values must be enclosed within single quotation marks
- Each character string is output once for each row teturned


------------------------------------------------------------------------------------------------------------------
Duplicate Rows
- The default display of queries is all rows,including duplicate rows
- If you don't need the duplicate rows , using the keyword DISTINCT

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8633028/viewspace-906309/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 从0开始
请登录后发表评论 登录
全部评论
  • 博文量
    55
  • 访问量
    424546