WEIGHT_STRING()
WEIGHT_STRING() is a SQL function in the MySQL Specific category. MySQL: returns the sort weight of a string. Useful for understanding collation-based comparison results. The syntax is WEIGHT_STRING(string [AS type] [flags]). It accepts string. It returns weight hex string. A typical example: SELECT WEIGHT_STRING('abc' AS CHAR); -- 0x616263 (hex ASCII values for a, b, c) -- See how case-insensitive collation works: SELECT WEIGHT_STRING('A' AS CHAR(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci); -- Same weight as lower case 'a' -- Debug collation issues: SELECT WEIGHT_STRING('abc') = WEIGHT_STRING('ABC') AS collation_equal; A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy. A close relative is LAST_INSERT_ID(), which returns the AUTO_INCREMENT value generated by the most recent INSERT in the current connection.