>Hi all:
>I am using php4.0.3pl1 with MySQL 3.22.32 on Apache for RH Linux.
>
>I have a table/relation of sports, where amongst other categories, are
>teams, where there can be many 'teamNames' & 'teamInfos' for one sport.
>
>The problem here is that without the use of a composite key:
>'sportName' & 'TeamName', there can be no method of uniquely
>identifiying a row or tuple. A smuch of the info for each sport is
>repeated.
>
>Does MySQL support the use of composite keys? I am using phpMyAdmin
>2.1.0 to adminster my MySQL system, and this only seems to accept a
>single primary key for a single table.
>
>Any advice or other methods I could possibley employ, are most welcome.
>
>Regards:
>Russ

Yes sir, you can declare multi-column primary keys. After the column 
definitions, type
    PRIMARY KEY (<column list>)
This is covered in the online manual.

If you want to use an auto_increment field as the primary key, you 
can insure uniqueness in the SportName and TeamName fields by 
declaring a UNIQUE INDEX in the same way.

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak

-- 
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]

Reply via email to