auto add foregin key to other table
i was created 2 table and specify the primary and foregin key, but the problem is i dont know how to do when i want to insert value to the supplier TABLE and in the same time the supplier_id will be auto add to the product TABLE. SO how to do that?
Example: two table
CREATE TABLE supplier
( supplier_id numeric(10) PRIMARY KEY not null,
supplier_name varchar2(50) not null,
contact_name varchar2(50),
);
CREATE TABLE products
( product_id numeric(10) not null,
supplier_id numeric(10) not null,
FOREIGN KEY (supplier_id)
REFERENCES supplier(supplier_id)
);
|