Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Where clause and cartesian product

Re: Where clause and cartesian product

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Tue, 13 Dec 2005 07:51:55 -0500
Message-ID: <rLGdne-MBLxtXgPeRVn-gg@comcast.com>

"Hari" <excel_hari_at_yahoo.com> wrote in message news:1134474766.112984.161110_at_g44g2000cwa.googlegroups.com...
> Mark,
>
> Thanks for the reply.
>
> Anyway back to my original doubt. In the following example,
>
> select job_id, dept_name
> from employees e , departments d
> where e.dept_id = d. dept_id;
>
> Would a cartesian product occur in the above case? (as per you examples
> a cartesian product occurs only in cases which dont have a "Using"
> clause in them - am i right in this interpretation?)

your SQL statement is the equivalent of

select job_id, dept_name
from employees e join departments d using (dept_id)

which is the equivalent of

select job_id, dept_name
from employees e join departments d on (d.dept_id = e.dept_id)

they are all different valid syntaxes for an inner join, and the oracle optimizer determines the most efficient way to retrieve the rows, using any available indexes to reduce the amount of data examined (no cartesian products are involved in any joins, no matter the syntax)

>
> I went to OTN site and was blown over by the amount of documentation
> available, rather got confused as to which Docs would be suitable for
> me. I enrolled in Oracle mainly because I wanted to get comfortable
> with using Proc SQL in SAS etc and to some extent preparing myself for
> a future job(s) which might entail using Oracle databases for
> interfacing with SAS. SAS also has thousands of pages of documentation
> but am a little more comfortable wading through them, probably because
> my present company has SAS but not Oracle.
>
> In nutshell, I would be a potential user of databases (and not in to
> designing) and would like to know which docs from Oracle site would be
> useful for me. (I have enrolled for SQL and PL/SQL within Oracle and it
> is probably called as OCA certification??!!?). Presently I have
> downloaded PDF's of Oracle 9i SQL reference (release 2), Application
> developer's guide and Database concepts from Oracle site. I expected to
> find syntax of a select clause within SQL reference book but somehow
> didnt find it. In which PDF are stuff (beginner) like that given?

SELECT syntax is inthe SQL reference (are you perhaps looking in the SQL*Plus reference? SQL*Plus is Oracle's standard and traditional database interface tool, SQL is the language -- surprisingly many course texts and instructors claim SQL*Plus is Oracle's set of extensions to SQL)

It sounds like you've got the right manuals. Many responders in these groups also recommend

    http://asktom.oracle.com
    tom kyte's books 'Effective Oracle by Design' and 'Expert One on One Oracle'

    the 'Oracle By Example' series on Oracle's OTN website (http://www.oracle.com/technology/new/index.html)

and on www.psoug.org you'll find a number of good examples under 'Morgan's Library'

>
>> yikes! get a new teacher! really! if he/she doesn't know how it works
>> he/she
>> has no business teaching certification courses.
> Its so hard to find really "knowledgeable" teachers in training
> institutes out here. Blind parroting of information is considered as
> knowing the stuff and it gets propogated to a new batch of students.
> Hence newsgroups have become one of the chief/reliable sources for
> clearing my doubts.
>

which is why you'll see many posters here speak disparagingly of oracle certification -- you do well in researching the newsgroups and pursuing self-study

(also you'll do well not top-posting... it gets folks in these forums kinda ticked off)

++ mcs Received on Tue Dec 13 2005 - 06:51:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US