what is unique key in mysql
- unique is key and its always unique, that means no repeat ,
- unique is just like primary key but unique may be NULL and primary key is not NULL
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(column1, column2, column3,.....)
Comments
Post a Comment
If you Satisfied , Please Leave a comment