00 Votes

MySQL: What is the meaning of Unsigned?

Question by Guest | 2012-06-26 at 08:11

When creating a new column in MySQL, I can also adjust the attributes to "Unsigned". What does this setting mean and are there any benefits to Unsigned columns?

ReplyPositiveNegative
2Best Answer2 Votes

The settings for Signed and Unsigned regulate, whether the values of the relevant column can also be negative. If you set a column to Signed, the values can be positive or negative (they can have a sign), in the other case, if you set it to Unsigned, only positive values and zero are possible.

The advantage is obvious: If you set the column to unsigned, much wider ranges of values are covered with the same memory requirements. So, if you expect large values, but no negative ones, possibly, you can use a smaller integer type using the attribute "Unsigned" and with this, you can save space.

What savings and value ranges with Signed and Unsigned columns exactly occur with each integer type, you can experience in my little info table on all MySQL integer types.
2012-06-26 at 18:26

ReplyPositive Negative
Reply

Related Topics

Java: Declare unsigned Integer

Question | 2 Answers

MySQL: Integer Types

Info | 0 Comments

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.