create table temp_gunj_1
(
P1_COL1 NUMBER,
G1_COL2 NUMBER,
G1_COL3 NUMBER
);
create table temp_gunj_2
(
P2_COL1 NUMBER
G2_COL2 NUMBER NOT NULL,
G2_COL3 NUMBER NOT NULL,
G2_COL4 NUMBER
);
alter table temp_gunj_2 add constraint pk_temp_gunj_2
primary key (g2_col2, g2_col3) enable;
alter table temp_gunj_1 add constraint fk_temp_gunj_1
FOREIGN KEY (g1_col2,g1_col3)
references temp_gunj_2 (g2_col2,g2_col3);