데이터를 추가하는 것 말고, '수정' '삭제' 에 대해서 알아보도록 한다.

(수정)

id 가 2 인 행의 title 인 NPM 을 소문자로 바꾸고 싶다.

update topic set title='npm' where id=2;

select * from topic where id=2; 를 통해서 확인해보면,

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5dcfa7ea-8331-42da-bfdc-43d93259c37f/Untitled.png

대문자가 소문자로 바뀐 것을 확인할 수 있다.

만약, title과 description을 모두 바꾸고 싶다면,

update topic set title='npm', description='Node package manager' where id=2;

해당 코드를 통해서 데이터를 수정(Update)할 수 있다.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/15d2b67e-59e2-4cad-8939-84331151bb75/Untitled.png

만약....UPDATE 를 할 때, where 를 빠뜨리게 되면, 모든 데이터들이 동일하게 작성된다.

update topic set title='npm', description='Node package manager';