Re: Phone Number Column Advice

2005-07-29 Thread Peter Brawley

Scott Purcell wrote:

>I am waffling on how to handle a column of phone numbers. I am
>not sure what is common practice on the database side. Talking to
>some co-workers, some feel it would be fine to use a varchar and
>others think there should be 3 integer columns in the database
>for each number?

Parts of some phone numbers begin with '0', which you can't represent as 
an INT, so use CHAR.


PB

 




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005


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



Re: Phone Number Column Advice

2005-07-29 Thread Asad Habib
Hello. I posted a similar question a while back and received a bunch of
responses. It depends on how you plan to use the numbers. If you plan to
use them in calculations, then storing them as INTs is best. Also,
breaking a number into separate components makes sense if you plan to use
these components as qualifiers in WHERE clauses. I decided to store my
numbers as VARCHARS after considering these issues and to allow for
maximum flexibility although this is an inefficient use of memory.

HTH
Asad


On Fri, 29 Jul 2005, Scott Purcell wrote:

> Hello,
>
> I am waffling on how to handle a column of phone numbers. I am not sure what 
> is common practice on the database side. Talking to some co-workers, some 
> feel it would be fine to use a varchar and others think there should be 3 
> integer columns in the database for each number?
>
> Anyone have advice or know of best-practice on this subject?
>
>
> Thanks,
> Scott
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>

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



Re: Phone Number Column Advice

2005-07-29 Thread Martijn Tonies
Hi,

> I am waffling on how to handle a column of phone numbers. I am not sure
what is common practice on the database side. Talking to some co-workers,
some feel it would be fine to use a varchar and others think there should be
3 integer columns in the database for each number?
>
> Anyone have advice or know of best-practice on this subject?

Well, there was a long thread on this last week.

Anyway, given that a phone-number IS NOT an integer (eg: leading zeros),
it simply cannot be stored into a numerical column.

Also, these days, you might have character-based phone-numbers:

0800-AOLUSA.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


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