- We can restrict the rows returned from the query by using the WHERE clause.
SELECT * | { [DISTINCT] column / expression [alias],...} FROM table [WHERE condition ];
Example :
SELECT name,job,FROM dept WHERE emp_id = 101;
*
|
/
|
+
|
-
|
|
Operator
|
Description
|
|
+
|
Add
|
|
-
|
Subtract
|
|
*
|
Multiply
|
|
/
|
Divide
|
|
Emp_name
|
Emp_id
|
Location
|
Dept_Name
|
Salary
|
|
Arun
|
101
|
Salem
|
Accounts
|
12000
|
|
Balu
|
109
|
Chennai
|
Purchase
|
15000
|
|
Ramesh
|
200
|
Salem
|
Admin
|
13000
|
|
Saravanan
|
150
|
Coimbatore
|
Sales
|
14500
|
|
Velu
|
333
|
Trichy
|
Production
|
10500
|
|
Gopi
|
104
|
Salem
|
Marketing
|
15000
|
|
Prabu
|
108
|
Salem
|
IT
|
12500
|
|
Dept_Name
|
Location
|
|
Accounts
|
Salem
|
|
Purchase
|
Chennai
|
|
Admin
|
Salem
|
|
Sales
|
Coimbatore
|
|
Production
|
Trichy
|
|
Marketing
|
Salem
|
|
IT
|
Salem
|
|
STATEMENTS
|
DESCRIPTIONS
|
|
SELECT
|
Retrieves data from the database.
|
|
INSERT
UPDATE
DELETE
MERGE
|
Enters new rows, changes existing rows, and removes unwanted rows
from tables in the database, respectively. Collectively known as Data Manipulation
Language (DML)
|
|
CREATE
ALTER
DROP
RENAME
TRUNCATE
|
Sets up, changes, and removes data structures from tables.
Collectively known as Data Definition Language (DDL).
|
|
COMMIT
ROLLBACK
SAVEPOINT
|
Manages the changes made by DML statements. Changes to the data can
be grouped together into logical transactions.
|
|
GRANT
REVOKE
|
Gives or removes access rights to both the Oracle database and the
structures within it. Collectively known as Data Control Language (DCL)
|