In article <[EMAIL PROTECTED]>,
"Jigal van Hemert" <[EMAIL PROTECTED]> writes:

> From: "Martijn Tonies"
>> Ehm... it might be me - but what sense does it make to have a NULL
>> in a PK?
>> If you "need" this, then your primary key probably isn't a primary key.
>> 
>> Care to explain why and how you're designing your database?

> Martijn,

> The table contains an variable number of integer parameters for accounts:

> id INT(11) - accountID
> name VARCHAR(32) - parameter name
> value INT(11) - parameter value

> Other tables contain string, datetime, etc. parameters.

> Since most searches are made for a value (or range) of one or more
> parameters, a usable primary key is:
> name-value-id

That's a horrible denormalization.  If one named parameter can hold
only one INT value for one account id, then (id, name) could be a
primary key; otherwise, you'd need a surrogate primary key.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to