Select * from tablename
SQL> select * from employees;
Select select list from tablename
SQL> select employee_id, first_name from employees;
Select distinct... From tablename
SQL> select distinct manager_id from employees;
| Use of connectors, addition, subtraction, multiplication, division, and brackets
SQL> select employee_id, first_name | '.' | last_name, salary * (1 + 0.1)/100, manager_id
2 from employees;
+-Use the plus or minus sign
SQL> select-salary from employees;
<>,>, <, = ,! = And Other comparison Operators
SQL> select * from employees where salary> 13000;
SQL> select * from employees where salary <13000;
SQL> select * from employees where salary <> 13000;
SQL> select * from employees where salary = 13000;
In
SQL> select-salary from employees where employee_id in (100,101,102 );
SQL> select-salary from employees where employee_id in (select employee_id from employees );
Not in
SQL> select-salary from employees where employee_id not in (100,101,102 );
Any (more than Any one)
Select * from employees where employee_id> any (100,101,102 );
Some is the equivalent of the SQL-92 standard any
Select * from employees where employee_id> any (100,101,102 );
All (better than all)
Select * from employees where employee_id> all (100,101,102 );
Between and
Select * from employees where employee_id between 100 and 102;
Not between and
Select * from employees where employee_id not between 100 and 102;
Logical operators
And or
Select * from employees where employee_id> 100 and employee_id <1000;
Select * from employees where employee_id> 100 or employee_id <1000;
Order
Desc
Select * from employees where employee_id between 100 and 102 order by employee_id desc;
Asc
Select * from employees where employee_id between 100 and 102 order by employee_id asc;
The dual table can be used when no table needs to be queried.
Select sysdate from dual;
Select 1*2*3*4*5 from dual;