Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!news-out.cwix.com!newsfeed.cwix.com!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
From: DA Morgan <damorgan@exxesolutions.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: And the correct answer is?
Date: Fri, 04 Apr 2003 17:12:22 -0800
Organization: EXE
Message-ID: <3E8E2D76.4B020B9E@exxesolutions.com>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
References: <3E8E0B9E.B0B9251F@noway.org> <MPG.18f7921965ee7e3898971e@news.la.sbcglobal.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cache-Post-Path: yasure!unknown@splish28.drizzle.com
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
X-Complaints-To: abuse@supernews.com
Lines: 53
Xref: newsfeed1.easynews.com comp.databases.oracle.server:182076
X-Received-Date: Fri, 04 Apr 2003 18:13:02 MST (news.easynews.com)

Karsten Farrell wrote:

> nospan@noway.org said...
> > The following is from a text..... I would like some opinions .... what
> > is the correct answer.
> >
> > EMP Table is defined as follows:
> > EMPNO            NUMBER            4
> > ENAME            VARCHAR2        30
> > SALARY           NUMBER            14,2
> > COMM             NUMBER            10,2
> > DEPTNO            NUMBER            2
> >
> > You perform the following tow queries:
> >
> > 1. SELECT empno enumber, ename FROM emp ORDER BY 1;
> > 2. SELECT empno, ename FROM emp ORDER BY ASC;
> >
> > Which of the following is true?
> > A. Statements 1 and 2 will produce the same result.
> > B. Statement 1 will execute; statement 2 will return an error.
> > C. Statement 2 will execute; statement 1 will return an error.
> > D. Statement 1 and 2 will execute but produce different results.
> >
> Oh, goodie! A contest! What do I win if I'm the first to get the right
> answer?
>
> I choose answer "A" ... because I forgot to login as SCOTT, who owns the
> EMP table ... and both queries (once I corrected the syntax error in
> query #2) produced the exact same result - no rows returned.
>
> But wait, since I had to correct the syntax error, does that mean "B" is
> correct?
>
> No, wait again ... after I corrected the query #2 syntax error, I needed
> to run it in pl/sql, and forgot to supply an INTO clause. Once I added
> that, it returned too many rows and I got another error. Darn! It can't
> be "C" because I got 2 errors instead of AN error on query #1.
>
> Oh, ok ... I think I got it now ... it's definitely "D" ... because
> after all the changes I've made, they definitely return different
> answers.
> --
> /Karsten
> DBA > retired > DBA

Ah but wouldn't a DBA have dumped the scott schema as soon as the database
was created? So the schema and table wouldn't exist.

I think you should just log on as SYS and try again.

Daniel Morgan

