Select: Retrieving Data Using The SQL Statement
Select: Retrieving Data Using The SQL Statement
Select: Retrieving Data Using The SQL Statement
Projection Selection
Table 1 Table 1
Join
Table 1 Table 2
SELECT *
FROM departments;
• iSQL*Plus:
– Default heading alignment: Center
– Default heading display: Uppercase
• SQL*Plus:
– Character and Date column headings are left-
aligned
– Number column headings are right-aligned
– Default heading display: Uppercase
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
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;
…
SELECT DISTINCT department_id
FROM employees;
2
SQL statements
Oracle
server
Internet
browser
Formatted report
Client
1
6
2 3 4 5
DESC[RIBE] tablename
DESCRIBE employees
D:\TEMP\emp_data.sql
2
3
2
3