what is unique key in mysql

  1. unique  is key and its always unique,    that means no repeat  ,
  2. unique is just like primary key but unique  may be NULL and primary key is not NULL

how to create unique key in mysql table

CREATE TABLE  tablename
(
id  int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
UNIQUE (id)
)



how to create unique key in mysql with multiple columns


create unique key with combination of multiple column


alter table tbName add unique index(column1column2column3,.....)

Comments

Popular posts from this blog

Call PHP Function In JavaScript Using Ajax

List of Post Category Wise in wordpress