I have this table:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (P_Id)
)
1. insert into persons values (1, 'John', 'Smith', 'LA', 'LA');
2. insert into persons (p_id, lastname, firstname, address, city) values (2, 'John', 'Smith', 'LV', 'LV');
How can I insert data into a table, without specifying a value for a primary key (the primary key doesn't have the "auto_increment" attribute).
I tried with:
- insert into persons values ('John', 'Smith', 'LA', 'LA');
- insert into persons values (null, 'John', 'Smith', 'LA', 'LA');
- insert into persons values (auto, 'John', 'Smith', 'LA', 'LA');
but no luck