| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> How to code a supertype subtype relationship
Let's talk about supertype-subtype relationship. Here's the problem:
I have to use a column in the supertype to find a corresponding
subtype. Here's an example:
Say we have a supertype, S, with three subtypes, X, Y, and Z. I add a row, R1, to supertype S. I now add a row to subtype Y that corresponds to the row R1 in supertype S.
Later, I query row R1 in supertype S. I now have a problem: which subtype corresponds to R1 in S. X, Y, or Z? Well, I have solved this problem by adding a column to S that tells its type in this case Y. So, I look at the type column in R1 and then lookup the child row in subtype Y.
Is there a better way to code this?
How do other people work with a supertype-subtype relationship?
bogston Received on Tue Mar 23 2004 - 16:05:56 CST
![]() |
![]() |