Creating JSON Values JSON_MERGE_PRESERVE()  takes two or more JSON documents and returns the combined result: +---------------------------------------+ mysql>  SELECT JSON_MERGE_PRESERVE(’["a", 1]’, ’{"key": "value"}’); +-----------------------------------------------------+ | JSON_MERGE_PRESERVE(’["a", 1]’, ’{"key": "value"}’) | +-----------------------------------------------------+ | ["a", 1, {"key": "value"}] | +-----------------------------------------------------+ 1 row in set (0.00 sec) mysql>  SET @j = JSON_OBJECT(’key’, ’value’); mysql>  SELECT @j; +------------------+ | @j | +------------------+ | {"key": "value"} | +------------------+ For information about the merging rules, see Normalization, Merging, and Autowrapping of JSON Values. (MySQL 8.0.3 and later also support  JSON_MERGE_PATCH() , which has somewhat different behavior. See JSON_MERGE_PATCH() compared with JSON_MERGE_PRESERVE(), for information about the differences between these two functions.) JSON values can be assigned to user-defined variables: However, user-defined variables cannot be of  JSON  data type, so although  @j  in the preceding example looks like a JSON value and has the same character set and collation as a JSON value, it does  not  have the  JSON  data type. Instead, the result from  JSON_OBJECT()  is converted to a string when assigned to the variable. Strings produced by converting JSON values have a character set of  utf8mb4  and a collation of utf8mb4_bin : Because  utf8mb4_bin  is a binary collation, comparison of JSON values is case-sensitive. Case sensitivity also applies to the JSON  null ,  true , and  false  literals, which always must be written in lowercase: 2071 mysql>  SELECT JSON_VALID(’null’), JSON_VALID(’Null’), JSON_VALID(’NULL’); +--------------------+--------------------+--------------------+ | JSON_VALID(’null’) | JSON_VALID(’Null’) | JSON_VALID(’NULL’) | +--------------------+--------------------+--------------------+ | 1 | 0 | 0 | +--------------------+--------------------+--------------------+ mysql>  SELECT JSON_ARRAY(’x’) = JSON_ARRAY(’X’); +-----------------------------------+ | JSON_ARRAY(’x’) = JSON_ARRAY(’X’) | +-----------------------------------+ | 0 | +-----------------------------------+ mysql>  SELECT CHARSET(@j), COLLATION(@j); +-------------+---------------+ | CHARSET(@j) | COLLATION(@j) | +-------------+---------------+ | utf8mb4 | utf8mb4_bin | +-------------+---------------+