db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Moore <bradm6...@hotmail.com>
Subject RE: Determine which child table a record belongs to
Date Tue, 29 Jan 2008 18:08:31 GMT
No problem.  Glad to be of help.

If you have a CraneType column in the master table then you could use
that to determine which other table has associated data for that
Crane.  i.e. if CraneType = "ROUGHTERRAIN" then look in the RoughTerrainCrane table.


> Date: Tue, 29 Jan 2008 10:04:26 -0800
> From: mz_tricsta@yahoo.com
> To: derby-user@db.apache.org
> Subject: RE: Determine which child table a record belongs to
> Thanks for your help, Brad. You are absolutely right. In this case, it
> doesn't make sense to have so many tables. I will make the changes you
> suggest. However, there are times when it does make sense to have this kind
> of hierarchical structure such as when the child tables have different
> fields, so my question remains: How would I determine which of the child
> tables the key belongs to without querying each child table? I appreciate
> any further assistance.
> Again Thanks,
> Tricsta
> Brad Moore wrote:
> > 
> > Can I suggest changing the "Crane" table to include a CraneType column or
> > something similar?  I don't know if there is a reason that's not obvious
> > to me why you need all of the other tables.  It looks like you're using
> > the other tables to determine the type of crane, the same thing could be
> > done with one additional column in the Crane table.  That would simplify
> > your database design a lot.  Unless I'm missing something.
> > 
> > Brad
> > 
> > 
> -- 
> View this message in context: http://www.nabble.com/Determine-which-child-table-a-record-belongs-to-tp15164998p15165402.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.


View raw message