{"id":127,"date":"2024-08-23T08:01:20","date_gmt":"2024-08-23T08:01:20","guid":{"rendered":"https:\/\/www.yehger.com\/?p=127"},"modified":"2024-09-25T06:28:38","modified_gmt":"2024-09-25T06:28:38","slug":"3-mysql-string-data-types","status":"publish","type":"post","link":"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/3-mysql-string-data-types\/","title":{"rendered":"3. Mysql &#8211; String Data Types"},"content":{"rendered":"<h2>String Data Types<\/h2>\n<table>\n<thead>\n<tr>\n<th>Date Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CHAR(size)<\/td>\n<td>A FIXED length string (can contain letters, numbers, and special characters). The size parameter specifies the column length in characters - can be from 0 to 255. Default is 1<\/td>\n<\/tr>\n<tr>\n<td>VARCHAR(size)<\/td>\n<td>A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters - can be from 0 to 65535<\/td>\n<\/tr>\n<tr>\n<td>BINARY(size)<\/td>\n<td>Equal to CHAR(), but stores binary byte strings. The size parameter specifies the column length in bytes. Default is 1<\/td>\n<\/tr>\n<tr>\n<td>VARBINARY(size)<\/td>\n<td>Equal to VARCHAR(), but stores binary byte strings. The size parameter specifies the maximum column length in bytes.<\/td>\n<\/tr>\n<tr>\n<td>TINYBLOB<\/td>\n<td>For BLOBs (Binary Large OBjects). Max length: 255 bytes<\/td>\n<\/tr>\n<tr>\n<td>TINYTEXT<\/td>\n<td>Holds a string with a maximum length of 255 characters<\/td>\n<\/tr>\n<tr>\n<td>TEXT(size)<\/td>\n<td>Holds a string with a maximum length of 65,535 bytes<\/td>\n<\/tr>\n<tr>\n<td>BLOB(size)<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMTEXT<\/td>\n<td>Holds a string with a maximum length of 16,777,215 characters<\/td>\n<\/tr>\n<tr>\n<td>MEDIUMBLOB<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 16,777,215 bytes of data<\/td>\n<\/tr>\n<tr>\n<td>LONGTEXT<\/td>\n<td>Holds a string with a maximum length of 4,294,967,295 characters<\/td>\n<\/tr>\n<tr>\n<td>LONGBLOB<\/td>\n<td>For BLOBs (Binary Large OBjects). Holds up to 4,294,967,295 bytes of data<\/td>\n<\/tr>\n<tr>\n<td>ENUM(val1, val2, val3, ...)<\/td>\n<td>A string object that can have only one value, chosen from a list of possible values. You can list up to 65535 values in an ENUM list. If a value is inserted that is not in the list, a blank value will be inserted. The values are sorted in the order you enter them<\/td>\n<\/tr>\n<tr>\n<td>SET(val1, val2, val3, ...)<\/td>\n<td>A string object that can have 0 or more values, chosen from a list of possible values. You can list up to 64 values in a SET list<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>reference<\/h2>\n<p><a href=\"https:\/\/www.w3schools.com\/mysql\/mysql_datatypes.asp\">https:\/\/www.w3schools.com\/mysql\/mysql_datatypes.asp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>String Data Types Date Type Description CHAR(size) A FIXED length string (can contain letters, numbers, and special characters). The size&#8230; <a class=\"read-more\" href=\"https:\/\/www.yehger.com\/index.php\/2024\/08\/23\/3-mysql-string-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-127","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/127","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=127"}],"version-history":[{"count":1,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/posts\/127\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yehger.com\/index.php\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}