
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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)
- Related Articles
- Difference between MySQL BigInt(20) and Int(20)?
- BigInt in JavaScript
- 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?
- Using BigInt to calculate long factorials in JavaScript
- 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
- Explain the difference between 20, 02, and 03.
- Difference between MySQL and MongoDB
- Difference Between MySQL and PostgreSQL
- Difference between Schema and Database in MySQL?
- Difference between MySQL and SQL Server
- Difference between count(*) and count(columnName) in MySQL?

Advertisements