0
我在所有6張桌子,但我想要一個外鍵添加到一個表(用戶)來引用對方表SQL中的外鍵錯誤 - 無法更新子行的錯誤
我得到一個錯誤,我無法更新子行錯誤1452
我是相當新的SQL。誰能幫助我的空值是否錯誤?
grant all on election.* to 'user_id'@'localhost';
set password for 'user_id'@'localhost' =password('userpassword');
CREATE TABLE user
(
const_id INT (11) ,
username VARCHAR (25) NOT NULL,
passwd VARCHAR (25) NOT NULL,
const VARCHAR (40) NOT NULL,
PRIMARY KEY (const_id)
);
ALTER TABLE user ADD Foreign Key (passwd) references party (party_id);
對方表......
CREATE TABLE party
(
party_id VARCHAR (25) ,
member VARCHAR (20),
leader VARCHAR (20),
address VARCHAR (25),
PRIMARY KEY(party_id)
);
哪個dbms你...? – 2012-08-16 01:56:09