- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL BigInt zerofill vs int zerofill?
The difference between MySQL BigInt and int is that INT is a 32-bit long while BIGINT is 64-bit long.
The following are some of the points −
The BigInt takes 8 bytes of storage while int takes 4 bytes of storage.
The int takes 4294967295 maximum values for int(10), whereas 18,446,744,073,709,551,615 for the bigint(20).
The BigInt(20) and int(10), in this 20 and 10 can be used for width display with zerofill.
Here is the demo of Bigint and int with zerofill. The following is the query to create a table.
mysql> create table BigintandintDemo −> ( −> Number1 bigint zerofill, −> Number2 int zerofill −> ); Query OK, 0 rows affected (0.62 sec)
Now you can insert records in the table. The query is as follows −
mysql> insert into BigintandintDemo values(234556667777,678999); Query OK, 1 row affected (0.17 sec)
Display all records from the table with the help of select statement. The query is as follows −
mysql> select *from BigintandintDemo;
The following is the output −
+----------------------+------------+ | Number1 | Number2 | +----------------------+------------+ | 00000000234556667777 | 0000678999 | +----------------------+------------+ 1 row in set (0.00 sec)
- Related Articles
- What is the usage of ZEROFILL for INT datatype?
- What is the benefit of zerofill in MySQL?
- Set custom Auto Increment with ZEROFILL in MySQL
- What is the usage of zerofill in a MySQL field?
- Difference between MySQL BigInt(20) and Int(20)?
- int(5) vs. int(10) in MySQL?
- Difference between BIGINT and BIGINT(20) in MySQL?
- Is there a difference in using INT(1) vs TINYINT(1) in MySQL?
- Is BIGINT(8) the largest integer MySQL can store?
- Set a custom value for AUTO_INCREMENT while creating a table and use ZEROFILL. What will happen now when nothing is inserted while using INSERT statement?
- BigInt in JavaScript
- How do I cast a type to a BigInt in MySQL?
- MySQL - CAST DECIMAL to INT?
- How to understand if a bigint is signed or unsigned in MySQL?
- MySQL data types int versus enum?

Advertisements