If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > DB layout help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-10, 19:03
Stephen68 Stephen68 is offline
Registered User
 
Join Date: Oct 2010
Posts: 1
DB layout help

I am making a site that will display items for sale but not sure how to layout my
DB.Should I make a table with the name of each item group
(e.g. Spring,coils.ect..) and then make a table with the name of the different
types of the item and the last table containing the items information.

Not sure if I'm explaining this right, for that I am sorry I am very tired.

So here is what I was thinking
Table
[item_groups]
group_id PK
group_name


Table
[sub_groups]
sub_id PK
group_id FK
sub_names

Table
[items]
item_id PK
sub_id FK
group_id FK
item_name
item_weight
item_price
ect...


would this be the right line of thinking, thanks for any help you guys might have.

Steve
Reply With Quote
  #2 (permalink)  
Old 10-09-10, 03:00
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
have a look at normalisation
Fundamentals of Relational Database Design -- r937.com
The Relational Data Model, Normalisation and effective Database Design

resist the temptation to have a table per product type
after all a product is a product
if you have unique attributes on a product type then consider using a sub table for those attributes
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On