01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

24<br />

CHAPTER 2 SQL AND PL/SQL<br />

Listing 2-2. Examples of Commands<br />

<br />

<br />

<br />

<br />

<br />

Figure 2-3 is a greatly simplified version of the railroad diagram for the statement.<br />

It is obvious, even from this simplified version, that statements can range<br />

from the very simple <strong>to</strong> the staggeringly complex.<br />

subquery_fac<strong>to</strong>ring_clause<br />

subquery<br />

SELECT<br />

ALL<br />

subquery<br />

;<br />

DISTINCT<br />

,<br />

where_clause<br />

select_list FROM table_reference<br />

UNION<br />

ALL<br />

order_by_clause<br />

MINUS<br />

( subquery )<br />

INTERSECT<br />

subquery_fac<strong>to</strong>ring_clause<br />

,<br />

WITH query_name AS ( subquery<br />

)<br />

Figure 2-3. Railroad diagram for the statement<br />

The diagram starts out with an optional subquery fac<strong>to</strong>ring clause of the kind you<br />

encountered in the first chapter. Manda<strong>to</strong>ry clauses include a list and a list of<br />

tables <strong>to</strong> be joined. A list is some combination of data items from the data records<br />

that are joined <strong>to</strong>gether. Optional clauses include a clause and an clause;<br />

the clause specifies criteria satisfied by the data items in the records that are joined<br />

<strong>to</strong>gether, and the clause sorts the results of the query.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!