{"id":132,"date":"2024-08-23T09:12:24","date_gmt":"2024-08-23T09:12:24","guid":{"rendered":"https:\/\/www.yehger.com\/?p=132"},"modified":"2024-09-25T06:28:33","modified_gmt":"2024-09-25T06:28:33","slug":"4-mysql-numeric-data-types","status":"publish","type":"post","link":"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/4-mysql-numeric-data-types\/","title":{"rendered":"4. Mysql \u2013 Numeric Data Types"},"content":{"rendered":"<h2>Numeric Data Types<\/h2>\n<table>\n<thead>\n<tr>\n<th>BIT(size)<\/th>\n<th>A bit-value type. The number of bits per value is specified in size. The size parameter can hold a value from 1 to 64. The default value for size is 1.<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>TINYINT(size) &quot;dont use size&quot;<\/td>\n<td>A very small integer. Signed range is from -128 to 127. Unsigned range is from 0 to 255. The size parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>BOOL<\/td>\n<td>Zero is considered as false, nonzero values are considered as true.<\/td>\n<\/tr>\n<tr>\n<td>BOOLEAN<\/td>\n<td>Equal to BOOL<\/td>\n<\/tr>\n<tr>\n<td>SMALLINT(size)<\/td>\n<td>A small integer. Signed range is from -32768 to 32767. Unsigned range is from 0 to 65535. The size parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMINT(size)<\/td>\n<td>A medium integer. Signed range is from -8388608 to 8388607. Unsigned range is from 0 to 16777215. The size parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>INT(size)<\/td>\n<td>A medium integer. Signed range is from -2147483648 to 2147483647. Unsigned range is from 0 to 4294967295. The size parameter specifies the maximum display width (which is 255)<\/td>\n<\/tr>\n<tr>\n<td>INTEGER(size)<\/td>\n<td>Equal to INT(size)<\/td>\n<\/tr>\n<tr>\n<td>FLOAT(size, d)<\/td>\n<td>A floating point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. This syntax is deprecated in MySQL 8.0.17, and it will be removed in future MySQL versions<\/td>\n<\/tr>\n<tr>\n<td>FLOAT(p)<\/td>\n<td>A floating point number. MySQL uses the p value to determine whether to use FLOAT or DOUBLE for the resulting data type. If p is from 0 to 24, the data type becomes FLOAT(). If p is from 25 to 53, the data type becomes DOUBLE()<\/td>\n<\/tr>\n<tr>\n<td>DOUBLE(size, d)<\/td>\n<td>A normal-size floating point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter<\/td>\n<\/tr>\n<tr>\n<td>DECIMAL(size, d)<\/td>\n<td>An exact fixed-point number. The total number of digits is specified in size. The number of digits after the decimal point is specified in the d parameter. The maximum number for size is 65. The maximum number for d is 30. The default value for size is 10. The default value for d is 0.<\/td>\n<\/tr>\n<tr>\n<td>DEC(size, d)<\/td>\n<td>Equal to DECIMAL(size,d)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Numeric Data Types BIT(size) A bit-value type. The number of bits per value is specified in size. The size parameter&#8230; <a class=\"read-more\" href=\"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/4-mysql-numeric-data-types\/\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":1,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/132\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}