1
假設外國參考鍵,我們有以下兩個表格如何創建組成主鍵
Create table Bank (
Bank_ID Numeric Not Null,
Bank_Card Numeric Not Null,
Primary Key(Bank_ID, Bank_Card)
)
Create table Customer (
Customer_ID Numeric Not Null,
Name varchar(30) Not Null,
Primary key(Customer_ID)
)
凡通過連接Bank_ID和Bank_Card產生CUSTOMER_ID。我如何設置外鍵Customer_ID來引用Bank_ID和Bank_Card
簡答:你不行。長的答案是重新設計表格或添加生成的列。 –