Search This Blog

Oracle PL/SQL Tutorial

 

Oracle is a relational database technology developed by Oracle.

Oracle Tutorial

Oracle is a relational database technology developed by Oracle.

PLSQL stands for "Procedural Language extensions to SQL", and is an extension of SQL that is used in Oracle. PLSQL is closely integrated into the SQL language, yet it adds programming constructs that are not native to SQL.

Our tutorial will start with the basics of Oracle such as how to retrieve and manipulate data. Then we will move to the more advanced topics such as how to create tables, functions, procedures, triggers, tablespaces, and schemas. We will conclude with a review of the functions that are proprietary to Oracle.

With this tutorial, you should be on your way to becoming proficient in Oracle and PLSQL.

Prerequisites

There are no prequisities for this Oracle tutorial. You should be able to easily understand this tutorial and learn the basic concepts of Oracle as you progress to the more advanced topics.

Now, let's get started!

Start Tutorial

Or jump directly to a topic in Oracle/PLSQL:

Oracle/PLSQL Functions

Functions - AlphabeticalOracle/PLSQL Functions listed alphabetically
Functions - CategoryOracle/PLSQL Functions listed by category

Oracle Keys, Constraints and Indexes

Primary KeysCreate, alter, drop, enable and disable primary keys
Foreign KeysCreate, drop, enable and disable foreign keys
Unique ConstraintsCreate, alter, drop, enable and disable unique constraints
Check ConstraintsCreate, alter, drop, enable and disable check constraints
IndexesCreate, rename and drop indexes (performance tuning)

Oracle Privileges, Synonyms, Roles and Passwords

Grant/Revoke PrivilegesGrant or revoke privileges
Synonyms (create, drop)Create, replace and drop synonyms
RolesSet of privileges
Change PasswordChange a user's password

Oracle Database Administration

TablespacesAllocated space where schema objects are created
UsersDatabase accounts
SchemasLogically group objects with schemas

Oracle Programming

FunctionsCreate and drop functions
ProceduresCreate and drop procedures
TriggersCreate, drop, enable, and disable triggers
CursorsCreate cursors within stored programs
Literals (Constants)Text, integer and number literals
Declaring VariablesDeclare variables and constants
Exception HandlingException handling in code
Loops and Conditional StatementsFOR Loop, WHILE Loop, IF-THEN-ELSE and others
Sequences (Autonumber)Create and drop sequences
TransactionsCommits and rollbacks
Comments within SQLHow to create comments within your SQL statement

Oracle Error Messages

Oracle Error MessagesOracle error message explanations and resolutions

Oracle System Tables

Oracle System TablesOracle system tables and descriptions

Oracle Comparison Operators

Comparison OperatorsOperators such as =, <>, !=, >, <, and so on

Oracle Query Types

SELECT StatementRetrieve records from a table
INSERT StatementInsert records into a table
INSERT ALL StatementInsert multiple records into one or more tables
UPDATE StatementUpdate records in a table
DELETE StatementDelete records from a table
TRUNCATE TABLE StatementDelete all records from a table (no rollback)
UNION OperatorCombine 2 result sets (removes duplicates)
UNION ALL OperatorCombine 2 result sets (includes duplicates)
INTERSECT OperatorIntersection of 2 result sets
MINUS OperatorResult set of one minus the result set of another
SubqueriesA query within a query
PIVOT ClauseCreate a cross-tabulation query

Oracle Joins

JOIN TablesInner and Outer joins

Oracle Aliases

ALIASESCreate a temporary name for a column or table

Oracle Clauses

DISTINCT ClauseRetrieve unique records
FROM ClauseList tables and join information
WHERE ClauseFilter results
ORDER BY ClauseSort query results
GROUP BY ClauseGroup by one or more columns
HAVING ClauseRestrict the groups of returned rows

Oracle SQL Functions

COUNT FunctionReturn the count of an expression
SUM FunctionReturn the sum of an expression
MIN FunctionReturn the min of an expression
MAX FunctionReturn the max of an expression
AVG FunctionReturn the average of an expression

Oracle Conditions

AND Condition2 or more conditions to be met
OR ConditionAny one of the conditions are met
AND and ORCombine AND and OR conditions
LIKE ConditionUse simple pattern matching (wildcards) in a WHERE clause
REGEXP_LIKE ConditionUse regular expression matching in a WHERE clause
IN ConditionAlternative to multiple OR conditions
NOT ConditionNegate a condition
IS NULL ConditionTest for a NULL value
IS NOT NULL ConditionTest for a NOT NULL value
BETWEEN ConditionRetrieve within a range (inclusive)
EXISTS ConditionCondition is met if subquery returns at least one row

Oracle Tables and Views

CREATE TABLECreate a table
CREATE TABLE ASCreate a table from another table's definition and data
ALTER TABLEAdd, modify or delete columns in a table; rename a table
DROP TABLEDelete a table
GLOBAL TEMP TablesTables that are distinct within SQL session
LOCAL TEMP TablesTables that are distinct within modules and embedded SQL program
VIEWVirtual tables (views of other tables)

Oracle Data Types

Data TypesData Types in Oracle/PLSQL

Oracle Question and Answer

Question & AnswerVarious questions and answers

No comments:

Post a Comment

PL/SQL - Collections

A collection is an ordered group of elements having the same data type. Each element is identified by a unique subscript that represents its...