์ƒˆ์†Œ์‹

๐Ÿ“šStudy/ETC

[Mysql/MariaDB] tinyint, smallint, mediumint, int, bigint ์˜ ์ฐจ์ด(์ •์ˆ˜ ์œ ํ˜•)

  • -

 

 

 

 

tinyint

  • Storage(Bytes) : 1
  • Range1 : -128 ~ 127
  • Range2 : 0 ~ 255

smallint

  • Storage(Bytes) : 2
  • Range1 : -32,768 ~ 32,767
  • Range2 : 0 ~ 65,535

mediumint

  • Storage(Bytes) : 3
  • Range1 : - 8,388,608 ~ 8,388,607
  • Range2 : 0 ~ 16,777,215

int

  • Storage(Bytes) : 4
  • Range1 : - 2,147,483,648 ~ 2,147,483,647
  • Range2 : 0 ~ 4,294,967,295

bigint

  • Storage(Bytes) : 8
  • Range1 : -2^63 ~ 2^63-1
  • Range2 : 0 ~ 2^64-1

TINYINT 1 -128 0 127 255
SMALLINT 2 -32768 0 32767 65535
MEDIUMINT 3 -8388608 0 8388607 16777215
INT 4 -2147483648 0 2147483647 4294967295
BIGINT 8 - 2^63 0 2^63 - 1 2^64 - 1

 

 

reference:
https://dev.mysql.com/doc/refman/8.0/en/integer-types.html

 

MySQL :: MySQL 8.0 Reference Manual :: 11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT,

11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT MySQL supports the SQL standard integer types INTEGER (or INT) and SMALLINT. As an extension to the standard, MySQL also supports the integer types TINYINT, MEDIUMINT,

dev.mysql.com

 

https://mariadb.com/kb/en/numeric-data-type-overview/

 

Numeric Data Type Overview

Overview and usage of the numeric data types.

mariadb.com

 

๋ฐ˜์‘ํ˜•
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.