Title: Presentasi Tugas Akhir
1BASIS DATA I/2009-GENAP
SQL SELECT STATEMENT
Oleh Satrio Agung Wicaksono, S.Kom., M.Kom
2SQL SELECT STATEMENT
Objective
- List the capabilities of SQL SELECT statements
- Execute a basic SELECT statement
3SQL SELECT STATEMENT
Capabilities of SQL SELECT Statements
Projection
Selection
Table 1
Table 1
Join
Table 1
Table 2
4SQL SELECT STATEMENT
Basic SELECT Statement
SELECT DISTINCT columnexpression
alias,... FROM table
- SELECT identifies the columns to be displayed
- FROM identifies the table containing those
columns
5SQL SELECT STATEMENT
Selecting All Columns
SELECT FROM departments
6SQL SELECT STATEMENT
Selecting Specific Columns
SELECT department_id, location_id FROM
departments
7SQL SELECT STATEMENT
Writing SQL Statements
- SQL statements are not case-sensitive.
- SQL statements can be on one or more lines.
- Keywords cannot be abbreviated or splitacross
lines. - Clauses are usually placed on separate lines.
- Indents are used to enhance readability.
8SQL SELECT STATEMENT
Arithmetic Expressions
Operator Description
Add
- Subtract
Multiply
/ Divide
9SQL SELECT STATEMENT
Using Arithmetic Operators
SELECT last_name, salary, salary 300 FROM
employees
10SQL SELECT STATEMENT
Operator Precedence
SELECT last_name, salary, 12salary100 FROM
employees
SELECT last_name, salary, 12(salary100) FROM
employees
11P E N U T U P