Notice that the default values of the columns that do not appear in the REPLACE statement will be inserted to the corresponding columns. In case the column that has the NOT NULL attribute and does not have a default value, and you don’t specify the value in the REPLACE statement, MySQL will raise an error. This is a difference between the REPLACE and INSERT statements.
For example, in the following statement, we specify only the value for the name column, not the population column. MySQL raises an error message. Because the population column does not accept a NULL value and we did not specify a default value for it when we defined the cities table.