[EMAIL PROTECTED] wrote:
> 
> When is it appropriate to use Char instead of Varchar and vice versa?

Use char when you expect the length of the field to always be the same.
Use varchar when you're not sure.

Basically, when you're using varchar you're assigning a limit to the size
of the string that can be put into the field, whereas with char you're
saying that the string will always be exactly X characters long.

So, for instance, it would be appropriate to store serial numbers as char,
since most likely they will include alphabetical characters and will
always be exactly the same length. And it would be more appropriate to
store the name of the hardware component as a varchar, since that would be
a different length for each record.

Also: query, query, sql. Blasted filter.

-- 
John Klein, Database Applications Developer |  Omnia Mutantur,
Systems Group - Harvard Law School          |  Nihil Interit

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to