mysql PRIMARY KEY constraints


  Translation results:

UK [ˈpraiməri ki:] US [ˈpraɪˌmɛri ki]

Main (key) key (word)

mysql PRIMARY KEY constraintssyntax

Function: PRIMARY KEY constraint uniquely identifies each record in the database table.

Note: The primary key must contain a unique value. Primary key columns cannot contain NULL values. Every table should have a primary key, and every table can only have one primary key.

mysql PRIMARY KEY constraintsexample

// 在 "Persons" 表创建时在 "Id_P" 列创建 PRIMARY KEY 约束
CREATE TABLE Persons(Id_P int NOT NULL,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255),PRIMARY KEY (Id_P));

Popular Recommendations

Home

Videos

Q&A