Name

INSERT

Synopsis

INSERT INTO table [ (column, ...) ] VALUES ( values )

Inserts data into a table. This statement inserts the given values into the given columns. Columns in the table that are not given values are set to NULL. If you leave out the list of columns, the number of value given must exactly match the number of columns in the table.

Examples

# Insert a record into the 'people' table.
INSERT INTO people ( name, rank, serial_number ) VALUES ( 'Bob Smith',
    'Captain', 12345 )

Get MySQL and mSQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.