Hi,
When i add new product into "Products" table, a trigger will add a record into "stocks" table. Example; stock=10,productId=99
How can i do that? Thanks
CREATE TABLE products(
productId INT(10) NOT NULL AUTO_INCREMENT,
productName VARCHAR(10),
PRIMARY KEY (productId));
CREATE TABLE stocks(
stock INT(10),
productId INT(10),
FOREIGN KEY (productId) REFERENCES products(productId));