I know that signed data type holds negative and positive no's AND unsigned holds only positive integer.
But Whats the difference between the two.
bigint unsigned
AND bigint(20) unsigned
BIGINT UNSIGNED
is an eight-byte unsigned integer.
The 20 in BIGINT(20) means almost nothing. It's a hint for display width, it has nothing to do with storage. Practically, it affects only the ZEROFILL option:
CREATE TABLE foo ( bar INT(20) ZEROFILL );
INSERT INTO foo (bar) VALUES (1234);
SELECT bar from foo;
+----------------------+
| bar |
+----------------------+
| 00000000000000001234 |
+----------------------+
It's a common source of confusion for MySQL users to see BIGINT(20) and assume it's a size limit, something analogous to CHAR(20).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With