INSERT INTO products VALUES(NULL, 'Blouse', 17, 15, '{"colour": "white"}');
UPDATE products SET attr = JSON_REPLACE(attr, '$.colour', 'red') WHERE name = 'Blouse';
ALTER TABLE fields_companies
ADD CONSTRAINT json CHECK(data
IS NULL OR JSON_VALID(data
));
ALTER TABLE products
ADD attr_colour
VARCHAR(32) AS (JSON_VALUE(attr
, '$.colour'));
CREATE INDEX products_attr_colour_ix ON products(attr_colour
);