Академический Документы
Профессиональный Документы
Культура Документы
NAME OF TRAINER :
M.ATIQ PATEL & M. YASIR
2
Name of Students
SELECT *
FROM departments;
11
SELECT STATEMENT
SELECT DEPARTMENT_ID,
DEPARTMENT_NAME,MANAGER_ID,LOACTION_ID FROM DEPARTMENTS;
12
Clauses of the SELECT
statement
SELECT
List the columns (and expressions) to be returned from the query
FROM
Indicate the table(s) or view(s) from which data will be obtained
WHERE
Indicate the conditions under which a row will be included in the
result
GROUP BY
Indicate categorization of results
HAVING
Indicate the conditions under which a category (group) will be
included
ORDER BY
Sorts the result according to specified criteria
13
Selecting Specific Columns
14
Selecting Specific Columns
SELECT emp_ssn;
ERROR at line 1:
ORA-00923: FROM keyword not found where
expected
17
Arithmetic Expressions
Operator Description
+ Add
- Subtract
* Multiply
/ Divide
18
Using Arithmetic Operators
…
19
Selecting from the DUAL Table
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.)
Using Column Aliases
SELECT last_name AS name, commission_pct comm
FROM employees;
…
24
Concatenation Operator
A concatenation operator:
Links columns or character strings to other columns
Is represented by two vertical bars (||)
Creates a resultant column that is a character
expression
…
25
Literal Character Strings