- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between BIGINT and BIGINT(20) in MySQL?
The only difference between BIGINT and BIGINT(20) is for displaying width. The 20 can be used for displaying width.
Let us see an example and create a table. Here, we have set BIGINT(20) −
mysql> create table DemoTable ( Number bigint(20) zerofill ); Query OK, 0 rows affected (0.58 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable values(12); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(123); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(1234); Query OK, 1 row affected (0.11 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output. The width is now 20, therefore the number expands and visible like below −
+----------------------+ | Number | +----------------------+ | 00000000000000000001 | | 00000000000000000012 | | 00000000000000000123 | | 00000000000000001234 | +----------------------+ 4 rows in set (0.00 sec)
- Difference between MySQL BigInt(20) and Int(20)?
- MySQL BigInt zerofill vs int zerofill?
- Is BIGINT(8) the largest integer MySQL can store?
- How do I cast a type to a BigInt in MySQL?
- How to understand if a bigint is signed or unsigned in MySQL?
- How to use BIGINT(8)value in Android sqlite?
- Get the count of unique phone numbers from a column with phone numbers declared as BIGINT type in MySQL
- Difference between MySQL and MongoDB
- Difference Between MySQL and PostgreSQL
- Difference between MySQL and SQL Server
- Difference between Schema and Database in MySQL?
- Difference between count(*) and count(columnName) in MySQL?
- What is the difference between SQL and MySQL?