SQL statements are not case sensitive
SQL statements can be on one or more lines
Keywords cannot be abbreviated or split across 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博客 ” ,链接:http://blog.itpub.net/8633028/viewspace-906309/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8633028/viewspace-906309/