Professional Documents
Culture Documents
order_details varchar2(50),
order_date varchar2(10),
customer_id number);
references customer(customer_id);
parents_noofchildrens number );
parent_id number );
references parent_table(parent_id);
Adding foreign key column to children_table with delete cascade,update cascade,delete set null
conditions:
When a delete occurs on the row from the parent table, it automatically delete the matching rows in
the child table.
foreign key(parent_id)
on delete cascade;
When a update occurs on the row from the parent table, it automatically update the matching rows
in the child table.
foreign key(parent_id)
on update cascade;
The foreign key column from the parent table will be set null when the children record gets deleted.
foreign key(parent_id)
Delete:
CONSTRAINT_NAM
E CONSTRAINT_TYPE
C_CONTACTNUMBE
U
R
C_ID P
C_NAME C
ORD_ID P
CONSTRAINT_NAME CONSTRAINT_TYPE
C_NAME C
C_ID P
C_CONTACTNUMBER U