Is this a good query?
View Single Post
02-23-2008, 04:59 AM
Join Date: Nov 2007
Good call on the ALTER statement to create a UNIQUE index. In cases like this where you want to avoid users having the same username, the easiest way to implement it (and have the benefits of using an index) is with UNIQUE.
Originally Posted by
Thanks for your help. I didn't think that more than 4 people would have an account on this, so I just made it a smallint.
Well, that will certainly hold 4 accounts.
TINYINT (unsigned) is up to 255.
SMALLINT (unsigned) will run up to 65,535.
INT (unsigned) is up to 4,294,967,295 (yes, that's trillion).
In your case, especially for test tables or small user groups, TINYINT(2) UNSIGNED (to 99) will usually suffice. Just one byte per value.
MySQL Manual :
I reject your reality, and substitute my own.
View Public Profile
Send a private message to SOCK
Find More Posts by SOCK