Re: Newbie question about BIGINT and INT in the same table
From: The Natural Philosopher <tnp_at_invalid.invalid>
Date: Sun, 27 Oct 2019 14:57:05 +0000
Message-ID: <qp4b82$n8i$1_at_dont-email.me>
>
> Ok, now I understood, I could use for the age also VARCHAR(3) because it
> means I can insert in a row till three numbers (I know VARCHAR is for
> string but I could use also to insert numbers!) but the column's value
> is "infinity" so I could have a column of millions and millions of
> values but these values are till three items!
>
> The mistake was to think to the columns and not to the value of the row!
>
yes. https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
Date: Sun, 27 Oct 2019 14:57:05 +0000
Message-ID: <qp4b82$n8i$1_at_dont-email.me>
On 27/10/2019 10:09, ^Bart wrote:
>> You use the size of variable you need. if the values in the age column >> are really going to exceed the time to the heat death of the universe, >> use a bigint
>
> Ok, now I understood, I could use for the age also VARCHAR(3) because it
> means I can insert in a row till three numbers (I know VARCHAR is for
> string but I could use also to insert numbers!) but the column's value
> is "infinity" so I could have a column of millions and millions of
> values but these values are till three items!
>
> The mistake was to think to the columns and not to the value of the row!
>
yes. https://dev.mysql.com/doc/refman/8.0/en/integer-types.html
BIGINT will store up to ± 2^63 and is an 8byte (64 bit) stirage type
INT is 32 bit so but so around +1 1 billion
> Thanks!
> ^Bart
The online mysql manual is really where you need to be finding this stuff out
-- Those who want slavery should have the grace to name it by its proper name. They must face the full meaning of that which they are advocating or condoning; the full, exact, specific meaning of collectivism, of its logical implications, of the principles upon which it is based, and of the ultimate consequences to which these principles will lead. They must face it, then decide whether this is what they want or not. Ayn Rand.Received on Sun Oct 27 2019 - 15:57:05 CET