MySql primary key constraint with name
问题 Data definition statement: CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), CONSTRAINT pk_PersonID PRIMARY KEY (P_Id) ) What is the value and purpose of CONSTRAINT pk_PersonID PRIMARY KEY (P_Id) ? as opposed to this PRIMARY KEY (P_Id) ? MySql docs do not really say much about this except for this. 回答1: It's the same as MySQL ignores the CONSTRAINT pk_PersonID part. You can check by creating the table and