Beruflich Dokumente
Kultur Dokumente
Projection Selection
Table 1 Table 1
Join
Table 1 Table 2
DEPARTMENT_ID LOCATION_ID
------------- -----------
10 1700
20 1800
30 1700
Writing SQL Statements
Arithmetic Expressions
Null Values
in Arithmetic Expressions
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 if it is case-
sensitive
NAME COMM
------------------------- ----------
OConnell
Grant
Whalen
Hartstein
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
SELECT last_name||job_id AS "Employees"
FROM employees;
Employees
-----------------------------------
OConnellSH_CLERK
GrantSH_CLERK
WhalenAD_ASST
Literal Character Strings
Employee Details
-----------------------------------------
OConnell is a SH_CLERK
Grant is a SH_CLERK
Whalen is a AD_ASST
Hartstein is a MK_MAN
Alternative Quote (q) Operator
SQL> SELECT department_name || q'[, it's assigned Manager Id: ]' || manager_id
2 AS "Department and Manager" FROM departments;
…
SELECT DISTINCT department_id
FROM employees; 2
DEPARTMENT_ID
-------------
100
30
20
70
90
110
SQL and iSQL*Plus Interaction
SQL statements
Oracle
server
Internet
browser
Formatted report
Client
SQL iSQL*Plus
statements commands
D:\TEMP\emp_data.sql
2
3
Prepared By :
Foiz Mohammed Rashed