473,395 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How much can it hold?

Mr aldo
15
I know in MySQL with the INT type, you can also specify a length, such as INT(4), but I am currently having a problem.

How do you figure out the biggest number INT(4) can hold? Its probably an easy question, but I can't seem to find the answer.

Thanks!
Apr 18 '09 #1
1 3574
Atli
5,058 Expert 4TB
Hi.

Check out 10.2. Numeric Types in the manual. You can see the range list for all integer types there.

In short, a normal Integer is 4 bytes, so it's ranges are:
  • -2,147,483,648 to 2,147,483,647 (Signed)
  • 0 to 4,294,967,295 (Unsigned)

The number you specify when you create the field (for example, INT(4)) defines the display width of the field, not the amount of data it can hold.

It is meant as a guideline to applications that should left-pad the number when displayed.
If you create the number with the optional ZEROFILL attribute, MySQL will do this automatically for you.

For example, a column defined as: Int(5) ZEROFILL, containing the number 1, would output: 00001

But even if the number you insert is larger than the display width, MySQL will not truncate it.
(Given that it is not larger than the maximum for the type)
Apr 18 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: lostinspace | last post by:
After four+ years of using FrontPage in a limited capacity and having created over 600 pages on my sites, I've finally (at least for the most part) abandoned FP, to begin the process of converting...
2
by: don | last post by:
My question is, do C++ array of objects hold the objects or just the pointers to the objects..... I know Java arrays only hold pointers to objects, but I seem to remember that C++ arrays hold the...
1
by: Purnendu | last post by:
Hi, Can I keep more than one cursor open in a program? I have Program A which calls program B. I may go into Program B to fetch data from 3 different cursors. I want to keep all these 3 cursors...
0
by: 4.spam | last post by:
Hello. W2K, DB2 ESE V8.2.1 I created a dummy sql sp that returns 2 result sets. One of cursors inside it I declared as "with hold with return" and another as "with return" (without "with...
2
by: Noozer | last post by:
Code sample: dim hash as Hashtable 'Declare Hashtable .... hash.add (picOne.image, "picture") 'Error here picOne is a picturebox added to the form at design time with a GIF image applied....
14
by: Rich | last post by:
Yes, I need to store some values in an array type collection object that can hold 3 or more parameters per index. I have looked at the collection object, hashtable object and would prefer not to...
3
by: vtxr1300 | last post by:
I'm trying to create a login box control to use that simply exposes the username, password and remember me properties when the login button is clicked. I have the button click wired up and working...
0
by: Paul DeWitt | last post by:
I have a textbox on a Windows Form. I am wanting to display a popup form to request/validate info if the user clicks the textbox and have a different form (to delete data) load if the user either...
11
by: dotnetnoob | last post by:
in the old VB, you can use global variables to hold commonly use data. i'll like to pass a variables selected by user in the combobox, how do you hold this variable for other object to use. does...
0
by: DaTurk | last post by:
Hi, I need to have a native class hold on to a managed function pointer. Not a unmanaged class in a manged block. I mean an unmanaged class in an unmanaged block via #pragma unmanaged. I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.