php-db | 2001062
Date: 06/23/01
- Next message: Chadwick Rolfs: "Re: [PHP-DB] .htaccess"
- Previous message: Ermanno Iannacci: "Re: [PHP-DB] advantages/disads of primary keys and indices?"
- In reply to: Kristian Duske: "RE: [PHP-DB] Design conundrum..."
- Next in thread: Stephen van Egmond: "Re: [PHP-DB] Design conundrum..."
- Reply: Stephen van Egmond: "Re: [PHP-DB] Design conundrum..."
- Reply: Kristian Duske: "RE: [PHP-DB] Design conundrum..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 ( toni <email protected> ) http://www.infurma.es-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Chadwick Rolfs: "Re: [PHP-DB] .htaccess"
- Previous message: Ermanno Iannacci: "Re: [PHP-DB] advantages/disads of primary keys and indices?"
- In reply to: Kristian Duske: "RE: [PHP-DB] Design conundrum..."
- Next in thread: Stephen van Egmond: "Re: [PHP-DB] Design conundrum..."
- Reply: Stephen van Egmond: "Re: [PHP-DB] Design conundrum..."
- Reply: Kristian Duske: "RE: [PHP-DB] Design conundrum..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

