PDA

View Full Version : Tagging Database Schema


johnnyb
10-17-2006, 05:11 AM
Hi,

I am making an application that will support tagging. Is there a preferred database structure to make this work? I would think that the best way is to make an n:m relationship between the table that is being tagged and a table of tags, with a minor table between them. Is this the best way or is there a better way?

I am also looking for a way to tag multiple tables, (I have several things that I would like tagged: sites, pages, FAQs, messages, etc.), and I would like to somehow consolidate all of the tags into one table. Is this feasable or advisable?

I'm looking for ideas, please point me to some.

Thanks,
John

guelphdad
10-17-2006, 07:55 AM
your setup as described is the ideal scenario. you would use the same to tag multiple items, perhaps adding a column that suggests the type of item being tagged.

johnnyb
10-17-2006, 09:15 PM
Sounds like that's what I'll do then! Thanks a lot.