Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Please help me to design supertype-subtype ..
On Tue, 03 Oct 2006 08:33:37 -0700, krislioe wrote:
> Hi all,
>
> We are designing our entity, I am confused about the criteria to
> determine whether my two entity should be put into Supertype/Subtype
> relationship.
>
> 1)Just because two entities have common attributes, is it enough reason
> to create supertype-subtype on them ? What are other reason ?
No, it is not enough.
The only real reason I can identify is that the subtype is actually a special type of the supertype.
Cars and trucks share the same attributes. But cars are not 'a type of truck' and trucks are not a 'type of car'. Instead, both are subtypes of vehicle. So the supertype would be vehicle and the subtypes would be car and truck.
>
> 2)For example, I have two entities : Sales & SalesReturn. They have
> attributes in common. Should I make them supertype-subtype ?
>
Probably not.
I would suggest that both are types of transactions. The supertype could be .transaction'.
> 3) Does it make any sense to store Sales & SalesReturn in one table ?
It depends on a lot more factors. For a more complete discussion, I'd suggest reading 'The Art of SQL' (http://www.oreilly.com/catalog/artofsql/)
-- Hans Forbrich (mailto: Fuzzy.GreyBeard_at_gmail.com) *** Feel free to correct me when I'm wrong! *** Top posting [replies] guarantees I won't respond.Received on Tue Oct 03 2006 - 10:58:11 CDT