The REPLACE statement is MySQL-specific and works similarly to INSERT, except that if a record with the given primary key (PRIMARY KEY) already exists, it deletes the old record first and then inserts the new one. If the record does not exist, it simply adds it.