* RELATIONSHIPS
Solid Line = Must Be
Dashed Line = May Be
Single Line = One and Only One
Crow
UID = #
Secondary UID = ( # )
Mandatory attribute = ( * )
Optional Attribute = ( o )
* An SQL command is entered at the SQL prompt
* Only one statement can be current at any time within the buffer
Place a semicolon ( at the end of last clause
Place a semicolon or slash on the last line in the buffer
Place a slash at the SQL prompt
Issue a SQL*Plus RUN command at the SQL prompt
* Character and date column headings and data are left
* SQL*Plus ignores blank spaces before and after the arithmetic operator
* By default
* You can include the AS keyword before the alias name to comply with ANSI SQL
* 關於別名的使用(重點)
* A literal is any character
* Currently
* You can use the NVL function to convert any datatype
* In SQL*Plus
* You terminate the SQL buffer by either entering one of the terminator characters (semicolon or slash)
* SQLPLUS Command :
* SPO[OL] [filename[
* COLUMN 命令
JUS[TIFY] {align} Justifies the column heading (not the data) to be left
NOPRI[NT] Hides the column
NUL[L] text Specifies text to be displayed for null values
PRI[NT] Shows the column
TRU[NCATED] Truncates the string at the end of the first line of display
WRA[PPED] Wraps the end of the string to the next line
WOR[D_WRAPPED] Same as WRAPPED
L Represents local currency
*
COL[UMN] column Displays the current settings for the specified column
COL[UMN] Displays the current settings for all columns
COL[UMN] column CLE[AR] Clears the settings for the specified column
CLE[AR] COL[UMN] Clears the settings for all columns
* The selection capability in SQL allows you to choose rows in a table to be returned by a query
? SQL commands are not case sensitive
* ORDER BY clause is last in SELECT command
* If no ORDER BY clause
* ASC orders the rows in ascending order
* In Oracle
* You can order by position to save time
* Sort by position is especially useful when sorting by a long expression
* You can order by columns that are not in the SELECT list
* Conditions consist of the following:
*
* SQL Operator Precedence 優先次序 -(重點)
* = NULL that an error is not raised
* It may be faster and easier to eliminate rather than include
* Search conditions can contain either literal characters or numbers
* The % and _ symbols may be used in any combination with literal characters
* When you need to have an exact match for the actual
? 無ORDER BY時ORACLE缺省用什麼樣的順序顯示數據?ROWID?
* Functions are a very powerful feature of SQL and can be used to
Perform calculations on data
Modify individual data items
Manipulate output for groups of rows
Alter date formats for display
Convert column datatypes
* An argument may be one of the following:
A user
A variable value
A column name
An expression
* Features of Single Row Functions
They may expect one or more user arguments
You can nest them
You can use them in SELECT
* Lower()
INITCAP(): Converts alpha character values to uppercase for the first letter of each word
CONCAT(): 同 ||
SUBSTR(column|expression
NVL(column|expression
From:http://tw.wingwit.com/Article/program/Oracle/201311/16798.html