Jump to content

Field type for numbers?


Mutley

Recommended Posts

At the moment I use "INT" for storing 1 and 2 digit numbers. Is this right?

 

If you only have (and only will have) one or two digit numbers (0-99) in a column, you can use the TINYINT column and save a little bit of storage space over INT (1 byte vs. 4 bytes per record).

Link to comment
Share on other sites

when storing floating point numbers - especially when arithmetic will be involved (e.g. monetary numbers) - it will be beneficial to use DECIMAL in favor of FLOAT because of the precision. i know this is not what you were asking about, but FLOAT was mentioned and this little caveat is something you will need to be aware of.

 

as for smaller integer numbers, as mentioned above use TINYINT.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.