MySQL中的INSERT和UPDATE有什么区别? [英] What are differences between INSERT and UPDATE in MySQL?

查看:952
本文介绍了MySQL中的INSERT和UPDATE有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看来INSERTUPDATE对我做同样的事情.

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

在任何情况下我应该使用INSERT代替UPDATE,反之亦然吗?

Is there any occasions where I should use INSERT instead of UPDATE and vice versa?

推荐答案

CRUD操作INSERT是'C',而UPDATE是'U'.它们是持久性存储的四个基本功能中的两个.其他两个是SELECTDELETE.如果没有至少这四个操作,则无法将典型的数据库系统视为完整的数据库.

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.

使用INSERT插入新记录.

使用UPDATE更新现有记录.

这篇关于MySQL中的INSERT和UPDATE有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆