SELECT JSON_KEYS(metadata) FROM transactions LIMIT 1;SELECT metadata->'$.merchant.name', metadata->'$.risk_score' FROM transactions LIMIT 5;ALTER TABLE transactions ADD COLUMN risk_score DECIMAL(5,2) AS (metadata->'$.risk_score') VIRTUAL;CREATE INDEX idx_risk ON transactions(risk_score);SELECT merchant_name, AVG(risk_score) FROM transactions GROUP BY merchant_name HAVING AVG(risk_score) > 0.7;SELECT jt.* FROM transactions, JSON_TABLE(metadata, '$.tags[*]' COLUMNS(tag VARCHAR(50) PATH '$')) AS jt;Crestview FinTech stores transaction metadata as JSON blobs in a single metadata column. Analysts cannot query inside them and performance is terrible. You must extract the key paths, create generated columns for the hot fields, index the generated columns, and rewrite the JSON-heavy reports as efficient SQL.
No step-by-step guidance. Use the Reference window for command syntax only. You must determine the approach, the correct columns and order, and verify your own results.