I'm doing this homework for school and I would like my primary key (id) to go 1, 2, 3 and so forth. but if I delete a row and add a new person, it skips that number.
This is my query from mySQL workbench
CREATE TABLE IF NOT EXISTS person
(
id int(11) NOT NULL auto_increment primary key,
first_name varchar(45),
last_name varchar(45)
);
I'm not really sure where I have to look and what to change.
My addPerson statement is this:
public Person addPerson(Person p){
String sql = "INSERT INTO person (first_name, last_name) VALUES(?,?) ";
template.update(sql, p.getFirst_name(), p.getLast_name());
return null;
}
Also im not asking why it shouldn't be done but rather if it's possible or not