Definition:

  • Inserts new rows into an existing table.
  • The INSERT … VALUES, INSERT … VALUES ROW(), and INSERT … SET forms of the statement insert rows based on explicitly specified values.
  • The INSERT … SELECT form inserts rows selected from another table or tables.
  • You can also use INSERT … TABLE in MySQL 8.0.19 and later to insert rows from a single table.
  • INSERT with an ON DUPLICATE KEY UPDATE clause enables existing rows to be updated if a row to be inserted would cause a duplicate value in a UNIQUE index or PRIMARY KEY.
  • In MySQL 8.0.19 and later, a row alias with one or more optional column aliases can be used with ON DUPLICATE KEY UPDATE to refer to the row to be inserted.

INSERT

  • INSERT

Referrences:

  • value:
    • {expr | DEFAULT}
  • value_list:
    • value [, value] …
  • row_constructor_list:
    • ROW(value_list)[, ROW(value_list)][, …]
  • assignment:
    • col_name =
      • value
      • | [row_alias.]col_name
      • | [tbl_name.]col_name
      • | [row_alias.]col_alias
  • assignment_list:
    • assignment [, assignment] …