..because it defines a single key, which happens to consist of two fields. It is still a single primary key.
Gilbert Consellado wrote:But why MySQL accept this query
I mean that there can only be one "primary".
Gilbert Consellado wrote:what are you referring about "design-error"?
Having multiple fields in a primary key is quite common. Yes, a larger key has a slight performance penalty; it has to check more data than in a single field, and any index containing the key will also grow.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]