sql pl sql commands1
DESCRIPTION
project for sqlTRANSCRIPT
The result of any arithmetic expression involving null is null
Example: 5 + null returns null
Any comparison with null returns unknown
Example: 5 < null or null null or null = null
When new or old keywords are used in PL/SQL procedures they are preceded by colons(:) . e.g. :new.col_name or :old.col_name etc.
NOTE: SQL is not a case sensitive language.
To call a procedure first set:
set serveroutput on;
Then:
Call/exec/execute ;
to commit a transaction :
commit;
to rollback a transaction:
rollback;
to rename a table :
rename to ;
OR
alter table rename to ;
SQL alias:
select as from
OR
select from
E.g. for student table having name "StudentInfo" and a column "RollNumber"
select s.RollNumber RN from StudentInfo s;
NOTE: Aliases defined for the columns in the SELECT statement cannot be used in the WHERE clause to set conditions. Only aliases created for tables can be used to reference the columns in the table.
The below table describes each comparison operator.
Comparison OperatorsDescription
=equal to
, !=is not equal to
greater than
>=greater than or equal to