What are differences between INSERT and UPDATE in MySQL?

后端 未结 6 1449
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 15:42

It seems INSERT and UPDATE do the same things to me.

Is there any occasions where I should use INSERT instead of UPDATE<

相关标签:
6条回答
  • 2020-12-01 16:05

    Insert is for adding data to the table, update is for updating data that is already in the table.

    0 讨论(0)
  • 2020-12-01 16:08

    You cannot UPDATE a row that's not in a table.

    You cannot INSERT a row that's already in a table.

    0 讨论(0)
  • 2020-12-01 16:08

    An UPDATE statement can use a WHERE clause but INSERT cannot.

    0 讨论(0)
  • 2020-12-01 16:13

    Insert is for putting in a fresh record to the table. while the update enables you to modify the inserted record e.g. modifying data type etc.

    0 讨论(0)
  • 2020-12-01 16:17

    In CRUD operations, the INSERT is the 'C' and the UPDATEis the 'U'. They are two of the four basic functions of persistent storage. The other two are SELECT and DELETE. Without at least these four operations, a typical database system cannot be considered complete.

    Use INSERT to insert a new record.

    Use UPDATE to update an existing record.

    0 讨论(0)
  • 2020-12-01 16:20

    Insert can be useful to insert new record in BLANK row. While Update can be used to update row which is NOT BLANK.

    0 讨论(0)
提交回复
热议问题