El sábado 23 de junio de 2001 (13:52), Kristian Duske escribió:
The problem involves 2 tables, one of editors and one of categories, both
have unique ID numbers. Each editor can have authority over an arbitrary
number of categories, and conversely, each category can have an arbitrary
number of editors. So what is the best way to represent this in the DB?
(Which is PostgreSQL 7 BTW)
This is a so-called N:N relation, and this usually calls for a third table
to store the cross-relations:
table editors
id, name, email
table categories
id, name
table ediors_categories
editor (id of editor)
category (id of category)
With index in the third table, How would it be ?
PRIMARY KEY (editor, category)
or
KEY (editor),
KEY (category)
What's the better (more efficient and correct) ??
Regards
--
Antonio Mármol Albert ( [EMAIL PROTECTED] )
http://www.infurma.es
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]