Professional Documents
Culture Documents
Objectives
After completing this lesson, you should be able to do the
following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Identify and use the key features of Oracle SQL Developer
1-2
Projection
Selection
Table 1
Table 1
Join
Table 1
1-3
Table 2
Copyright 2009, Oracle. All rights reserved.
1-4
SELECT *
FROM
departments;
1-5
1-6
1-7
SQL Developer:
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
1-8
Arithmetic Expressions
Create expressions with number and date data by using
arithmetic operators.
Operator
+
Add
Subtract
Multiply
1-9
Description
Divide
1 - 10
Operator Precedence
1 - 11
1 - 12
Null Values
in Arithmetic Expressions
Arithmetic expressions containing a null value evaluate to null.
1 - 13
1 - 14
1 - 15
Concatenation Operator
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
FROM
last_name||job_id AS "Employees"
employees;
1 - 16
1 - 17
1 - 18
1 - 19
Duplicate Rows
The default display of queries is all rows, including duplicate
rows.
1
SELECT department_id
FROM
employees;
1 - 20
SQL Developer
1 - 21
SQL *Plus
SQL Developer
1 - 22
1 - 23
1 - 24
2
3
1 - 25
1 - 27
Enter SQL
Statements.
Results are
shown here.
1 - 28
1 - 29
F5
F5
F9
1 - 31
After
formatting
1 - 32
1
2
1 - 33
3
2
1 - 34
Or, select the table in the Connections tree and use the
Columns tab to view the table structure.
1 - 35
DESCRIBE employees
1 - 36
Summary
In this lesson, you should have learned how to:
Write a SELECT statement that:
Returns all rows and columns from a table
Returns specified columns from a table
Uses column aliases to display more descriptive column
headings
1 - 37