- 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
Difference between MySQL BigInt(20) and Int(20)?
The int type takes 4 byte signed integer i.e. 32 bits ( 232 values can be stored). The BigInt type takes 8 byte signed integer i.e. 64 bits (264 values can be stored).
Let us see an example.
Creating a table with zerofill, that would add leading zeros.
mysql> create table IntandBigint20Demo -> ( -> Number int(20) zerofill, -> Code BigInt(20) zerofill -> ); Query OK, 0 rows affected (0.58 sec)
After creating a table, we will insert records into the table.
mysql> insert into IntandBigint20Demo values(987,987); Query OK, 1 row affected (0.16 sec)
Now we can display all records with the help of select statment. The query is as follows −
mysql> select *from IntandBigint20Demo;
The following is the output.
+----------------------+----------------------+ | Number | Code | +----------------------+----------------------+ | 00000000000000000987 | 00000000000000000987 | +----------------------+----------------------+ 1 row in set (0.00 sec)
Look at the sample output, in the beginning, 0 gets filled. This itself states that 20 is the width in let’s say.
Number int(20) zerofill
- Related Articles
- Difference between BIGINT and BIGINT(20) in MySQL?
- MySQL BigInt zerofill vs int zerofill?
- Explain the difference between 20, 02, and 03.
- What is the difference between int and integer in MySQL?
- Difference Between int and long
- Difference between const int*, const int * const, and int const * in C
- Difference between const int*, const int * const, and int const * in C/C++?
- What is the difference between const int*, const int * const, and int const *?
- Solve using brackets: $( 20+20)times20+( 20-20)$.
- Difference between “int main()” and “int main(void)” in C/C++?
- What is difference between int and const int& in C/C++?
- C/C++ difference's between "int main()" and "int main(void)"
- Difference between an Integer and int in Java
- Difference between void main and int main in C/C++
- What is the difference between size_t and int in C++?

Advertisements