Datasheet

6
Chapter 1
Introducing SQL
SQL Category Description
Data Definition
Language (DDL)
Used to define, alter, or drop database objects and their privi-
leges. DDL statements include those to create, modify, drop, or
rename objects (
CREATE, ALTER, DROP, RENAME), remove all rows
from a database object without dropping the structure (
TRUNCATE),
manage access privileges (
GRANT, REVOKE), audit database use
(
AUDIT, NOAUDIT) and add a description about an object to the
dictionary (
COMMENT).
Transaction Control Used to group a set of DML statements as a single transaction.
Using these statements, you can save the changes (
COMMIT) or
discard the changes (
ROLLBACK) made by DML statements. Also
included in the transaction-control statements are statements
to set a point or marker in the transaction for possible rollback
(
SAVEPOINT) and to define the properties for the transaction
(
SET TRANSACTION).
Session Control Used to control the properties of a user session. (A session is the
point from which you are connected to the database until you dis-
connect.) Session-control statements include those to control the
session properties (
ALTER SESSION) and to enable/disable roles
(
SET ROLE).
System Control Used to manage the properties of the database. There is only one
statement in this category (
ALTER SYSTEM).
Table 1.1 provides an overview of all the statements that will be covered in this book.
Do not worry if you do not understand certain terms, such as role, session, privilege, and
so on. I will cover all the statements in the coming chapters with many examples. In this
chapter, I will begin with writing simple statements to query the database (
SELECT state-
ments). But first I’ll go over some fundamentals.
SQL Tools: SQL*Plus
The Oracle Database 11g software comes with two primary tools to manage data and
administer databases using SQL. SQL*Plus is a character-based command-line utility. SQL
Developer is a graphical tool that has the capability to browse, edit, and manage database
objects as well as to execute the SQL statements. On Windows platforms, these tools are
located under the Application Development subfolder in the Oracle 11g program group.
On Linux and Unix platforms, you can find these tools in the
bin directory under the
Oracle software installation (
$ORACLE_HOME/bin).
TABLE 1.1 SQL Statement Categories (continued)
95127c01.indd 6 2/18/09 6:37:06 AM