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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL question

Re: SQL question

From: Jared Still <jkstill_at_gmail.com>
Date: Mon, 16 Jan 2006 15:56:50 -0800
Message-ID: <bf46380601161556j3dd1db1dm8f7e856d5d230006@mail.gmail.com>


Comments inline:

On 1/13/06, Sandeep Dubey <dubey.sandeep_at_gmail.com> wrote:
>
> > I am sorry I can't be more helpful. I don't really see this as problem,
> to
> > me it's more of an exemple of bad data.
>
> I am not sure if it is a bad data model. It's battle of normalization
> - denormalization.

The example given would appear to be denormalized. There is no candidate key to start with.

I have a table Items. It's child is item_parts. Item can be made up of
> 1 or may parts. So it is right to store in a table like item_parts.
> okay?

The example does not match what you were trying to do. You won't get much help here with an example like that.

What you are trying to do requires 3 tables.

ITEMS, PARTS, and an intersection table.

If a a part can appear in more than 1 item, you can't store the PARTS data as a child table of ITEMS.

Now if business asks give me the item that EXACTLY matches these parts
> - no more no less, its a valid question too.

Yes, it is. You just can't answer it in a reasonable manner with 1 table, or 2 tables. Answering that particular question will probably still require some imaginative SQL.

--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jan 16 2006 - 17:57:33 CST

Original text of this message

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