Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Model for parts explosion
Old 08-21-2006, 05:41 AM Model for parts explosion
Junior Talker

Posts: 4
Trades: 0
Hi all,

I am designing a database to keep my company's product details.
There are parts, subassemblies and assemblies.
They go all in the table PART. And then I am suing a table ASSEMBLY
to define the hierarchies.

So far so good.

The problem is, I don't know whete to keep the part specific details
(for example weight, colour, size, power,etc)

I have about 70 different part types which are described by very different
attributes (like for engines the horsepower, rpms, weight might be interesting. For pumps it is only necessary to store the flow and pressure increase)

Up to now I was thinking of using a separate table for every part type and link them to the table PART as necessary. In this way I'll end up having some 70 tables...there must be a better solution.
Any suggestions??

Thank you for your comments.
dela_nuca is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-21-2006, 12:03 PM Re: Model for parts explosion
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
being a bit of a fanatic on data normalisation I probably go too far the other way, so the way I coded a catalogue system where I had/have no idea what it was going to be used for is;

An options table where the names of the attributes are listed;
Code:
id             autoincrement (integer);
active       enum;    Y or N 
name       varchar;  
comment  varchar;   information about  the record
option_details this is where the variables for each option are defined
Code:
id                 autoincrement (integer);
option_id       integer; foreign key to options.id
value            varchar;  value for this attribute
name            varchar;  name for the value (used for user friendly info)
options_prod Table for mapping the product table IDs to the options group and values
Code:
id                   autoincrement;
opt_group_id   integer; foreign key to options.id
prod_id           bigint;  foreign key to products.id 
opt_details_id  text; foreign keys to option_details.id.  this field is stored as a comma seperated value so can be used with a IN(csv) query
to use taking clothes as an example;

options table would contain records of
1. material,
2. weight,
3. colour,

option_details would contain records of
1. 1. Silk
2. 1. Cotton
3. 1. Wool
4. 2. Size 10
5. 2. Size 12
6. 2. Size 14
7. 3. Red
8. 3. Blue
9. 3. Purple

options_prod would be,
1. 1. 5. 1,2
2. 2. 5. 4,5,6
3. 3. 5. 8,9

which equates to prod Id 5 is available in silk & cotton, with sizes of 10, 12 & 14 and in colours of Blue & Purple.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Model for parts explosion
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33481 seconds with 12 queries