You are on page 1of 2

Data Definition Language (DDL) statements are used to define the database structure

or schema

CREATE - to create objects in the database


ALTER - alters the structure of the database
DROP - delete objects from the database

Data Manipulation Language (DML) statements are used for managing data within
schema objects.

SELECT - retrieve data from the a database


INSERT - insert data into a table
UPDATE - updates existing data within a table
DELETE - deletes all records from a table, the space for the records remain

Data Control Language (DCL) statements. Some examples:


GRANT - gives user's access privileges to database
REVOKE - withdraw access privileges given with the GRANT command

Transaction Control (TCL) statements are used to manage the changes made by DML
statements.
It allows statements to be grouped together into logical transactions.

COMMIT - save work done


SAVEPOINT - identify a point in a transaction to which you can later roll back
ROLLBACK - restore database to original since the last COMMIT

Joins are used to combine the data from two tables, with the result being a new,
temporary table.
The temporary table is created based on column(s) that the two tables share,

inner join
will return only the rows that actually match based on the join predicate

Outer Joins:
left outer joins, right outer joins, and full outer joins

A left outer join retains all of the rows of the left table,
regardless of whether there is no matching row on the right table.

A right outer join retains all of the rows of the right table,
regardless of whether there is no matching row on theleft table.

Cursors
A cursor is a temporary work area created in the system memory when a SQL statement
is executed.
A cursor can hold more than one row, but can process only one row at a time.
The set of rows the cursor holds is called the active set.

two types of cursors in PL/SQL:Implicit cursors,Explicit cursors.

Implicit cursors:
created when a SELECT statement that returns just one row is executed.
created by default when DML statements like, INSERT, UPDATE, and DELETE statements
are executed.

Explicit cursors
created when you are executing a SELECT statement that returns more than one row.

Data Definition Language (DDL) statements are used to define the database structure
or schema

You might also like