PostgreSQL - JSON and JSONB
Given the table products with a JSONB column attributes containing {"color": "red", "size": "M"}, what will this query return?
SELECT id FROM products WHERE attributes ? 'color';
Given the table products with a JSONB column attributes containing {"color": "red", "size": "M"}, what will this query return?
SELECT id FROM products WHERE attributes ? 'color';
attributes ? 'color' checks if the key 'color' exists in the JSONB column.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions