ok first, Foreign keys do not really 'join' tables, they rather 'relate' tables and the main reason why it is useful to create foreign key constraint in a table is serve as a checking mechanism to prevent actions that will cause data in a related table through an action like dropping a table etc
Below is a basic sql code showing a table with a foreign key cons.
CREATE TABLE Orders
(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
FOREIGN KEY (P_Id) REFERENCES Persons(P_Id)
)
but in joining two tables (in a sort of extension), then you would have to use sql
joins
, which if you dont have any knowledge of yet, I would edge you to do google it up and read..Also check up the sql
union
..:)