R
Rasoul Khoshravan Azar
Is it possible to have two Primary Key in a single Table?
Why do I ask this question?
After many misdesigns, I understand that it is a mistake to join one PK of a
single table to two different tables. This design format is totally wrong
and never works (if I am not right with this conclusion, please correct me).
As a solution, I am thinking to put to PK in a single table so to use each,
for separate join.
My DB is as follows:
This DB is aimed for the procedure of getting a ProformaInvoice(PI) from a
seller, opening a Letter of Credit (LC) in a bank and shipment of
commodities.
ProformaInvoiceTbl
PIID (PK)
SellerID (a foreign key)
PInumber (set as PK)
.... (other fields)
CommodityTbl
CommodityID (PK)
PIID (FK from ProformaInvoiceTbl)
.... (other fields)
BudgetAssignerTbl
AssignerID (PK)
PInumber (FK from ProformaInvoiceTbl)
.... (other fields)
TIA, Rasoul Khoshravan Azar
Why do I ask this question?
After many misdesigns, I understand that it is a mistake to join one PK of a
single table to two different tables. This design format is totally wrong
and never works (if I am not right with this conclusion, please correct me).
As a solution, I am thinking to put to PK in a single table so to use each,
for separate join.
My DB is as follows:
This DB is aimed for the procedure of getting a ProformaInvoice(PI) from a
seller, opening a Letter of Credit (LC) in a bank and shipment of
commodities.
ProformaInvoiceTbl
PIID (PK)
SellerID (a foreign key)
PInumber (set as PK)
.... (other fields)
CommodityTbl
CommodityID (PK)
PIID (FK from ProformaInvoiceTbl)
.... (other fields)
BudgetAssignerTbl
AssignerID (PK)
PInumber (FK from ProformaInvoiceTbl)
.... (other fields)
TIA, Rasoul Khoshravan Azar