instead of having key on FirstName
, you should have id as key. Also remove any key from FirstName
column.
you should think of in terms of memory versus functionality and speed
.
If you want to save memory by having a key on FirstName
column, you will have to sacrifice your functionality of having multiple persons having same name.
You should add an id
column with primary key on it in person
table.
As per your request, I am giving you template of person table
CREATE TABLE persons
(id int auto_increment primary key,
FirstName varchar(40),
LastName varchar(40),
details varchar(100),
...any other columns
)
if you do not have the id
field before then use
ALTER TABLE persons ADD id int auto_increment primary key;