I am analyzing some csv files here and based on them I am trying to create the DB structure, but apparently, one column from table2 has data from two different columns from table1. Can someone help me how can I recreate the same logic in SQL ?
I tried:
CREATE TABLE table1
(
field1 varchar(4),
field2 varchat(5),
PRIMARY KEY(field1, field2)
);
CREATE TABLE table2
(
field3 varchar(5) REFERENCES table1(field1, field2)
)
That didn't work. Any ideas?
Thank you