SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
-- basicly we need one table for store price changes history CREATE TABLE price_history ( id serial, price_date timestamp, price numeric ); -- for ability to store separated prices for different products -- we need to create table products CREATE TABLE products ( id serial primary key, name varchar ); -- and add column product_id into price_history ALTER TABLE price_history ADD product_id int REFERENCES products(id);
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear