PostgreSQL - Set Operations and Advanced Queries
Given the table
Assuming a row with name 'Pen' and stock 20 already exists.
products(id SERIAL PRIMARY KEY, name TEXT UNIQUE, stock INT), what will be the result of this query?INSERT INTO products(name, stock) VALUES ('Pen', 10) ON CONFLICT (name) DO UPDATE SET stock = products.stock + 5 RETURNING stock;Assuming a row with name 'Pen' and stock 20 already exists.
