MySQL Type questions
#1

Hi guys

I have few question's about MySQL types.

I'm really try to find tutorial for MySQL types for this what i need but without success.

1. When to use TinyInt,SmallInt,MediumInt,BigInt ? Because I use every time int(11)-for everything,is this wrong?

I'm find this:

Код:
tinyint: 1 byte, -128 to +127 / 0 to 255 (unsigned)
smallint: 2 bytes, -32,768 to +32,767 / 0 to 65,535 (unsigned)
mediumint: 3 bytes, -8,388,608 to 8,388,607 / 0 to 16,777,215 (unsigned)
int/integer: 4 bytes, -2,147,483,648 to +2,147,483,647 / 0 to 4,294,967,295 (unsigned)
bigint: 8 bytes, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 / 0 to 18,446,744,073,709,551,615 (unsigned)
Now i don't understand what means int(11) ?


2. When is better to use text then varchar?
For example for 128 string i use varchar(12,is this wrong?Is better to use text or?
Reply


Messages In This Thread
MySQL Type questions - by GospodinX - 11.06.2018, 13:12
Re: MySQL Type questions - by GTLS - 12.06.2018, 06:44
Re: MySQL Type questions - by Ada32 - 12.06.2018, 16:05
Re: MySQL Type questions - by RoboN1X - 12.06.2018, 18:24

Forum Jump:


Users browsing this thread: 1 Guest(s)