Re: Hi! All

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 03 Jul 2006 08:42:48 -0700
Message-ID: <1151941370.867909_at_bubbleator.drizzle.com>


Michel Cadot wrote:
> "DA Morgan" <damorgan_at_psoug.org> a écrit dans le message de news: 1151595765.559_at_bubbleator.drizzle.com...
> | Abha wrote:
> | > Can anyone send me SQL Question papers as I am preparing for OCP
> | > Examination.
> | [Quoted]
> | Sure ... here's my favorite.
> |
> | You have two tables that are absolutely identical in structure. Each
> | contains rows of data ... some of which are identical between the
> | tables and some of which are not. Find the rows that are distinct and
> | in one query return the distinct rows from both tables and the name
> | of the table that contained them.
> |
> | CREATE TABLE t1 (
> | col1 VARCHAR2(5));
> |
> | CREATE TABLE t2 (
> | col1 VARCHAR2(5));
> |
> | INSERT INTO t1 VALUES ('A');
> | INSERT INTO t1 VALUES ('B');
> | INSERT INTO t1 VALUES ('C');
> | INSERT INTO t2 VALUES ('A');
> | INSERT INTO t2 VALUES ('C');
> | INSERT INTO t2 VALUES ('D');
> | COMMIT;
> |
> | The result from the single query should be:
> |
> | A T1
> | D T2
> |
> | Enjoy!
> | --
> | Daniel A. Morgan
> | University of Washington
> | damorgan_at_x.washington.edu
> | (replace x with u to respond)
> | Puget Sound Oracle Users Group
> | www.psoug.org
>
> I think the result is:
>
> B T1
> D T2
>
> Can I compete? ;-)
>
> Regards
> Michel Cadot

[Quoted] So much for typing rather than cut and paste. Anyone want to post their answer?

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Jul 03 2006 - 17:42:48 CEST

Original text of this message