Syntax\n------\n\nUUID\n\nDescription\n-----------\n\nThe UUID data type is intended for the storage of 128-bit UUID (Universally Unique Identifier) data. See the UUID function page for more details on UUIDs themselves.\n\nRetrieval\n\nData retrieved by this data type is in the string representation defined in RFC4122.\n\nCasting\n\nString literals of hexadecimal characters and CHAR/VARCHAR/TEXT can be cast to the UUID data type. Likewise hexadecimal literals, binary-literals, and BINARY/VARBINARY/BLOB types can also be cast to UUID.\n\nThe data type will not accept a short UUID generated with the UUID_SHORT function, but will accept a value without the - character generated by the SYS_GUID function (or inserted directly). Hyphens can be partially omitted as well, or included after any group of two digits.\n\nThe type does not accept UUID values in braces, permitted by some implementations.\n\nStorage\n\nUUID values are stored in an index-friendly manner; the order of a UUID of llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn is stored as:\n\n``sql\nnnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll\n`\n\nThis provides a sorting order, assuming a UUIDv1 (node and timestamp) is used, of the node, followed by the timestamp. The key aspect is the timestamps are sequential.\n\nMariaDB starting with 10.10\n\nTaking into account that UUIDv7 and other versions are designed around time ordering, UUID values version >= 6 are stored without byte-swapping, and UUID values with version >=8 and variant=0 are now considered invalid (as the SQL standard suggests).\n\nUUID values version >= 6 are not stored without byte-swapping, and UUID` values with version >=8 and variant=0 are not considered invalid.\n\nExamples\n--------\n\nCREATE TABLE t1 (id UUID);\n\nURL: https://mariadb.com/docs/server/reference/data-types/string-data-types/uuid-data-type