Question Locked

MySQL INT data type

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I have started working in MySQL recently. I tried to import an excel into mysql table. everything is fine but for one column. I have defined a column called 'telephone_no' with int(30) as datatype. the data in the table after importing is absurd for a few records.. rest of the records seem fine. Dont know what is wrong. for example, i tried to insert the number '2825861214' but i get this number '2147483647'.. Please could anyone tell me what the problem and solution is ?

thank you

3 replies

by tony hopkinson

30 is the number of characters the value can take up in a fixed width field of the file.

BigInt (signed by default) takes up a maximum of 19 digits, unsigned it's 21 (I think) so you are allocating space that can never be used for the underlying data type. Character data type with a format specifier for input is better for telephone numbers anyway.

This discussion is closed to new replies.