0
問題很簡單。REFERENCES語句中的區別
假設下表已創建
CREATE TABLE Customer
(name varchar(20),
address varchar (40),
primary key (name));
我想知道什麼是寫一個表像這樣
CREATE TABLE Orders
(name varchar(20),
assembly_id numeric (9, 0),
primary key (assembly_id),
foreign key (name) references Customer);
之間像這樣
CREATE TABLE Orders
(name varchar(20),
assembly_id numeric (9, 0),
primary key (assembly_id),
foreign key (name) references Customer(name));
沒有區別,但第二個更可能是可讀的,因爲你明確提到了外鍵引用 –
我看到了謝謝。 – Yokhen