Chapter 1 introduces the SQL language and
describes its brief history. This chapter is primarily for those
readers who have little or no prior SQL experience.
You'll find simple examples of the core SQL
statements (SELECT, INSERT, UPDATE, and DELETE) and of
SQL's basic features.
Chapter 2 describes ways to filter data in your
SQL statements. You'll learn to restrict the results
of a query to the rows you wish to see, and restrict the results of a
data manipulation statement to the rows you wish to modify.
Chapter 3 describes constructs used to access
data from multiple, related tables. The important concepts of inner
join and outer join are discussed in this chapter. The new
ANSI-compliant join syntax introduced in Oracle9i is also discussed.
Chapter 4 shows you how to generate summary
information, such as totals and subtotals, from your data. Learn how
to define groups of rows, and how to apply various aggregate
functions to summarize data in those groups.
Chapter 5 shows you how to use correlated and
noncorrelated subqueries and inline views to solve complex problems
that would otherwise require procedural code together with more than
one query.
Chapter 6 talks about handling date and time
information in an Oracle database. Learn the tricks and traps of
querying time-based data. Also learn about
Oracle9i's many new date and
time datatypes.
Chapter 7 shows you how to use UNION, INTERSECT,
and MINUS to combine results from two or more independent component
queries into one.
Chapter 8 shows you how to store and extract
hierarchical information (such as in an organizational chart) from a
relational table. Oracle provides several features to facilitate
working with hierarchical data.
Chapter 9 talks about two very powerful yet
simple features of Oracle SQL that enable you to simulate conditional
logic in what is otherwise a declarative language. CASE, an ANSI
standard construct, was first introduced in
Oracle8i, and was enhanced in
Oracle9i.
Chapter 10 discusses the issues involved with
accessing partitions and collections using SQL. Learn to write SQL
statements that operate on specific partitions and subpartitions.
Also learn to query object data, nested tables, and variable arrays.
Chapter 11 explores the integration of SQL and
PL/SQL. This chapter describes how to call PL/SQL stored procedures
and functions from SQL statements, and how to write efficient SQL
statements within PL/SQL programs.
Chapter 12 deals with complex grouping operations
used mostly in decision support systems. We show you how to use
Oracle features such as ROLLUP, CUBE, and GROUPING SETS to
efficiently generate various levels of summary information required
by decision support applications. We also discuss the new Oracle9i
grouping features that enable composite and concatenated groupings,
and the new GROUP_ID and GROUPING_ID functions.
Chapter 13 deals with analytical queries and new
analytic functions. Learn how to use ranking, windowing, and
reporting functions to generate decision support information. This
chapter also covers the new analytic features introduced in
Oracle9i.
Chapter 14 talks about best practices that you
should follow in order to write efficient and maintainable queries.
Learn which SQL constructs are the most efficient for a given
situation. For example, we describe when it's better
to use WHERE instead of HAVING to restrict query results. We also
discuss the performance implications of using bind variables
vis-à-vis literal SQL.