I'm using derby db with NetBeans and I'm having some troubles with my tables:
I've TABLE_A and TABLE_B and i create them like this:
CREATE TABLE TABLE_A ( FIELD_1 varchar(20), FIELD_2 varchar(50), FIELD_3 varchar(2), PRIMARY KEY(FIELD_1,FIELD_2), ) and
CREATE TABLE TABLE_B ( FIELD_1 varchar(20), FIELD_2 varchar(50), FIELD_3 varchar(20), FIELD_4 varchar(25), PRIMARY KEY(FIELD_3), FOREIGN KEY(???) REFERENCES regioni(FIELD_1,FIELD_2) ) The question is: how can I link a TABLE_B record to an another TABLE_A record when TABLE_A has got a 2-fields primary key? What I have to put instead of "???"?
Thank you!!!
REFERENCES regioni (...)beREFERENCES TABLE_A (...)?