8.5. SQL Insert

8.5.1. Insert Values

INSERT INTO astronauts
VALUES ('Mark', 'Watney');

8.5.2. Insert Values to Columns

INSERT INTO astronauts (firstname, lastname)
VALUES ('Mark', 'Watney');
INSERT INTO astronauts (lastname, firstname)
VALUES ('Watney', 'Mark');

8.5.3. Insert to Autoincrement Column

INSERT INTO astronauts (id, firstname, lastname)
VALUES (NULL, 'Mark', 'Watney');

8.5.4. Prepared statements

For sequences (list, tuple, set):

INSERT INTO astronauts (firstname, lastname)
VALUES (?, ?);

For mappings (dict):

INSERT INTO astronauts
VALUES (NULL, :firstname, :lastname);