Home > database > Outside the SQL key decisions key why still can't insert duplicate data when inserting data?
Outside the SQL key decisions key why still can't insert duplicate data when inserting data?
Time:11-02
This is to create table code:
CREATE TABLE coordinating editor responsible for and the author ( EDIT_UID varchar (13) PRIMARY KEY, AUTHOR_UID varchar (13) NOT NULL, Foreign key (EDIT_UID) references to edit information table (EDIT_UID), Foreign key (AUTHOR_UID) references the author information table (AUTHOR_UID), );
Primary key have repeated will prompt can't insert duplicate keys, my feeling is when I create table statement has a problem, but I was a little white, don't know how to change, seek answers the duck!!!!!
CodePudding user response:
First of all, the primary key is definitely not allowed to repeat, even is the foreign key family key,
Since you take foreign key family key, why not just take edit information table to save the data in this table?
CodePudding user response:
Table, the primary key is the only... It is best to learn (book or baidu), foreign key Settings,