View Single Post
Join Date: Oct 2007
Posts: 39
Reputation: Tom Tolleson is an unknown quantity at this point 
Solved Threads: 0
Tom Tolleson's Avatar
Tom Tolleson Tom Tolleson is offline Offline
Light Poster

Database Design Question

 
0
  #1
Dec 4th, 2008
Hi!

I've got a table of, let's say, widgets. Each has a unique id (primary key) and a few other attributes such as

widgetid (unique, number)
widget_name (string)
widget_price (varchar)
widget_color (string)

BUT, for each widget, I also want to list other widgets (that are listed in the same table) that are similar to each widget, and list them by their unique id.

So, would I create a foreign key to another table of related widgets, or just have additional fields in this table for

related_widget_1
related_widget_2
related_widget_3

and have the widgetids listed in those fields?

Seems their must be a better way to do this.

Thanks!

THT
Last edited by Tom Tolleson; Dec 4th, 2008 at 4:30 pm.
Reply With Quote