mysql UNIQUE constraint


  Translation results:

UK [juˈni:k] US [juˈnik]

adj. Only, only; unique, unique; unusual, special; extraordinary

mysql UNIQUE constraintsyntax

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

Description: UNIQUE and PRIMARY KEY constraints both provide uniqueness guarantees for columns or column sets. PRIMARY KEY has automatically defined UNIQUE constraints. Note that you can have multiple UNIQUE constraints per table, but you can only have one PRIMARY KEY constraint per table.

mysql UNIQUE constraintexample

//Create a UNIQUE constraint on the "Id_P" column when the "Persons" table is created

CREATE TABLE Persons(Id_P int NOT NULL,LastName varchar(255) NOT NULL,FirstName varchar(255),Address varchar(255),City varchar(255),UNIQUE (Id_P));

Popular Recommendations

Home

Videos

Q&A