Results 1 to 2 of 2
Dec 11, 2000, 12:39 #1
- Join Date
- Dec 2000
- 0 Post(s)
- 0 Thread(s)
I recently asked some table descriptions of devshed.com's database. In "article" and "articlePage", I found that authorID is an int(6) where articleID is int(11). Then
articlePageNumber is smallint(11).
First of all, what is the difference between those types of int. In the manual I found:
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255.
SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535.
MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
A medium-size integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
INT[(M)] [UNSIGNED] [ZEROFILL]
A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.
So if I understand correctly, it is just the size the integer could take.
But, articleID is int (unsigned) so they can have more than 4'000'000'000 articles. Why do they think so big? And why do they use smallint for articleID. Does it have special meanings or something?
What about tinyint, wouldn't that fit already?
Secondly, what does that 11 and 6 between the parentheses mean? I don't get it. If I understand the manual correctly, it's the max number chars. But 11 chars in an integer is quite big no? A billion would fit in it!
Please help me out!