Oracle - The Basic Select
Oracle - The Basic Select
Objectives
Projection
Selection(Restriction)
Table 1
Table 1
Join
Table 2
Table 1
SELECT
SELECT
FROM
FROM
*|{[DISTINCT]
*|{[DISTINCT] column|expression
column|expression [alias],...}
[alias],...}
table;
table;
SELECT *
FROM
departments;
iSQL*Plus:
SQL*Plus:
Arithmetic Expressions
Create expressions with number and date data by using
arithmetic operators.
Operator
Description
Add
Subtract
Multiply
Divide
Operator Precedence
/ +
10
Operator Precedence
11
Using Parentheses
12
13
14
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
15
16
Concatenation Operator
A 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
17
SELECT
FROM
last_name||job_id AS "Employees"
employees;
18
19
20
Duplicate Rows
The default display of queries is all rows, including
duplicate rows.
SELECT
SELECT
FROM
FROM
department_id
department_id
employees;
employees;
21
22
iSQL*Plus
SQL statements
Oracle
server
Internet
Browser
Query results
iSQL*Plus
commands
Formatted report
Client
23
SQL
A language
ANSI standard
Keyword cannot be
abbreviated
Statements manipulate
data and table definitions
in the database
iSQL*Plus
An environment
Oracle proprietary
Keywords can be
abbreviated
Commands do not allow
manipulation of values in
the database
Runs on a browser
Centrally loaded, does not
have to be implemented
on each machine
iSQL*Plus
commands
SQL
statements
24
Overview of iSQL*Plus
25
Logging In to iSQL*Plus
From your Windows browser environment:
26
1
2
27
Summary
SELECT
SELECT
FROM
FROM
*|{[DISTINCT]
*|{[DISTINCT] column|expression
column|expression [alias],...}
[alias],...}
table;
table;
28