Retrieving Data Using The SQL SELECT Statement
Retrieving Data Using The SQL SELECT Statement
Retrieving Data Using The SQL SELECT Statement
SELECT *
FROM departments;
Operator Description
+ Add
- Subtract
* Multiply
/ Divide
…
SELECT last_name, salary, 12*(salary+100)
FROM employees;
2
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
…
SELECT last_name "Name" , salary*12 "Annual Salary"
FROM employees;
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 DISTINCT department_id
FROM employees;
2
…
1 - 18 Copyright © 2007, Oracle. All rights reserved.
Lesson Agenda
DESCRIBE employees