List:General Discussion« Previous MessageNext Message »
From:Hiep Nguyen Date:July 2 2007 1:11pm
Subject:database structure (fwd)
View as plain text  
is this list working?  my last post failed? re-try.

T. Hiep



---------- Forwarded message ----------
Date: Mon, 2 Jul 2007 05:53:17 -0700 (PDT)
From: Hiep Nguyen <hiep@stripped>
To: mysql@stripped
Subject: database structure

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

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Thread
database structure (fwd)Hiep Nguyen2 Jul