In conclusion, when you use ON DUPLICATE KEY UPDATE in the INSERT statement with the new record that causes the duplicate value in PRIMARY KEY or UNIQUE index, MySQL updates the old record and a new record.
In this tutorial, we have shown you how to use various forms of the MySQL INSERT statement to insert data into a database table.