- 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
What does INT(7) in MySQL mean?
In INT(7), the number indicates the display width. It does not affect the storage, as we know int takes 4 bytes. It has the range between -2147483648 and 2147483647.
To understand INT(7), let us create a table with zerofill column. The query to create a table is as follows −
mysql> create table DisplayInt -> ( -> Number int(7) zerofill -> ); Query OK, 0 rows affected (1.25 sec)
Insert some records in the table using insert command. The query is as follows −
mysql> insert into DisplayInt values(1); Query OK, 1 row affected (0.12 sec) mysql> insert into DisplayInt values(12); Query OK, 1 row affected (0.16 sec) mysql> insert into DisplayInt values(1234); Query OK, 1 row affected (0.19 sec) mysql> insert into DisplayInt values(12345); Query OK, 1 row affected (0.10 sec) mysql> insert into DisplayInt values(1234567); Query OK, 1 row affected (0.18 sec)
Display all records from the table using select statement. The query is as follows.
mysql> select *from DisplayInt;
The following is the output.
+--------+ | Number | +--------+ | 0000001 | | 0000012 | | 0001234 | | 0012345 | | 1234567 | +--------+ 5 rows in set (0.00 sec)
- Related Articles
- What does int argc, char *argv[] mean in C++?
- What does int argc, char *argv[] mean in C/C++?
- What does parenthesis mean in MySQL SELECT (COLNAME)?
- What does the KEY keyword mean in MySQL?
- What does the slash mean in a MySQL query?
- What does the method fill(int[], int fromIndex, int toIndex, int val) do in java?
- What does the method sort(int[] a, int fromIndex, int toIndex) do in java?
- What does the method copyOfRange(int[] original, int from, int to) do in java?
- What does the method fill(int[], int val) do in java?
- What does “unsigned” in MySQL mean and when to use it?
- What does the method fill(obj[], int fromIndex, int toIndex, int val) do in java?
- What does it mean by select 1 from MySQL table?
- What does the method equals(int[] a1, int[] a2) do in java?
- What does the method copyOf(int[] original, int newLength) do in java?
- What does the method removeRange(int fromIndex, int toIndex) do in java?

Advertisements