List:General Discussion« Previous MessageNext Message »
From:Hiep Nguyen Date:July 2 2007 2:53pm
Subject:database structure
View as plain text  
Hi all,

i'm seeking for help/suggestion on how to create relationship for this 
scenario:

I have one table (tag) with the following fields:

tagid, location, weight, grade, heat, shape, diameter, length, width, 
height, ... (and many other fields)


what i want to do is move the shape field into a different table, however, 
each shape will have different dimensions

for sample:

rod bar has diamter and length, but square/flat bar has width, height 
(thickness), and length.  wire has only diameter.

but i also don't want to create a huge table to hold all the possible 
fields in all shapes, so i'm thinking create a table per shape:

round table (diameter, length)
square table (width, height, length)
i-beam table (flange height, flange thickness, web thickness)
angle table (leg1, leg2, thickness)
...
and so on.

in turn, i have 2 tables: tag, shape + as many table as there are shapes

my question is: is there a better to do this?  how do i query with this 
structure? i'm a bit confuse on how to manipulate data if each shape have 
diffent fields???

Thank you for all your help (sorry for a long email)
T. Hiep
Thread
database structureHiep Nguyen2 Jul
RE: database structureRajesh Mehrotra2 Jul
  • Re: database structureBorokov Smith2 Jul
    • Re: database structureHiep Nguyen2 Jul
      • Re: database structureChristophe Gregoir2 Jul
        • Re: database structureHiep Nguyen2 Jul
          • Re: database structureMogens Melander2 Jul
            • RE: database structureHiep Nguyen3 Jul
              • Re: database structureBorokov Smith3 Jul
  • RE: database structureHiep Nguyen2 Jul