I am making an application which inserts users into a MySQL database.
I know you can make a column value unique, but I want a combination of 2 columns in a record to be unique.
For example:
id firstname lastname creationdate
-----------------------------------------
1 John Doe (today)
2, John, Deo, (today)
2, John, Doe, (today)
use the below query
ALTER TABLE Persons
ADD CONSTRAINT pk_PersonID PRIMARY KEY (FirstName,LastName)