Unit 2 - Retrieve Data using the SQL SELECT Statement
Unit 2 - Retrieve Data using the SQL SELECT Statement
SELECT *
FROM departments;
SQL Developer:
• Default heading alignment: Left-aligned
• Default heading display: Uppercase
In SQL Developer, column headings are displayed in
uppercase and are left-aligned.
SELECT last_name, hire_date, salary
FROM employees;
Example:
SELECT last_name, salary, 12*salary+commission_pct
FROM employees;
A column alias:
• Renames a column heading
• Is useful with calculations
• Immediately follows the column name (optional AS
keyword between the column name and the alias)
• Requires double quotation marks if it contains spaces
or special characters, or if it is case-sensitive
A column alias:
• Renames a column heading
• Is useful with calculations
• Immediately follows the column name (optional AS
keyword between the column name and the 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;
DESC[RIBE] tablename
DESCRIBE employees