Education*
Devops
Architecture
F/B End
B.Chain
Basic
Others
CLOSE
Search For:
Search
BY TAGS
linux
HTTP
golang
flutter
java
fintech
개발환경
kubernetes
network
Docker
devops
database
tutorial
cli
분산시스템
www
블록체인
AWS
system admin
bigdata
보안
금융
msa
mysql
redis
Linux command
dns
javascript
CICD
VPC
FILESYSTEM
S3
NGINX
TCP/IP
ZOOKEEPER
NOSQL
IAC
CLOUD
TERRAFORM
logging
IT용어
Kafka
docker-compose
Dart
MySQL Update Statement
Recommanded
Free
YOUTUBE Lecture:
<% selectedImage[1] %>
yundream
2023-08-14
2022-08-27
1178
# MySQL UPDATE Statement 모든 쿼리는 연습용 데이터베이스를 통해서 실행해 볼 수 있다. [MySQL & SQL 스터디 준비](https://www.joinc.co.kr/w/mysql_study_ready) 를 참고하여 실습환경을 구축하자. UPDATE 문은 **레코드의 내용을 수정**하기 위해서 사용한다. ### Syntax ```sql UPDATE table_name SET column1=value1, column2=value2, column3=value3, ... WHERE condition; ``` UPDATE 문을 수행 할 때는 반드시 WHERE 문을 사용하도록 한다. WHERE 절을 사용하지 않은 경우 모든 레코드의 컬럼을 수정하게 된다. ### Example 아래와 같이 exmployees 테이블을 유지하고 있다. ```sql SELECT EmployeeID, LastName, FirstName, Title, City FROM employees; ``` | EmployeeID | LastName | FirstName | Title | City | | ---------- | -------- | --------- | ----- | ---- | | 1 | Davolio | Nancy | Sales Representative | Seattle | | 2 | Fuller | Andrew | Vice President, Sales | Tacoma | | 3 | Leverling | Janet | Sales Representative | Kirkland | | 4 | Peacock | Margaret | Sales Representative | Redmond | | 5 | Buchanan | Steven | Sales Manager | London | | 6 | Suyama | Michael | Sales Representative | London | | 7 | King | Robert | Sales Representative | London | | 8 | Callahan | Laura | Inside Sales Coordinator | Seattle | | 9 | Dodsworth | Anne | Sales Representative | London | EmployeeID 7인 employees가 Seattle로 발령이 나면서, City를 Update하기로 했다. ```sql UPDATE employees SET City='Seattle' WHERE EmployeeID = 7; ``` 성공적으로 UPDATE 됐는지 확인해 보자. ```sql SELECt EmployeeID, LastName, FirstName, Title, City FROM employees WHERE EmployeeID = 7; ``` 하나의 명령문으로 여러 개의 컬럼을 업데이트 해보자. Buchanan 은 Seattle로 발령나면서 Sales Representative 로 Title이 변경됐다. City와 Title를 업데이트해보자. ```sql UPDATE employees SET Title='Sales Representative', City='Seattle' WHERE EmployeeID = 5; ``` ## 참고 [SQL Study With MySQL](https://www.joinc.co.kr/w/sql_study_with_mysql_index) 에서 MySQL과 관련된 다른 문서들을 읽을 수 있습니다.
Recent Posts
Vertex Gemini 기반 AI 에이전트 개발 06. LLM Native Application 개발
최신 경량 LLM Gemma 3 테스트
MLOps with Joinc - Kubeflow 설치
Vertex Gemini 기반 AI 에이전트 개발 05. 첫 번째 LLM 애플리케이션 개발
LLama-3.2-Vision 테스트
Vertex Gemini 기반 AI 에이전트 개발 04. 프롬프트 엔지니어링
Vertex Gemini 기반 AI 에이전트 개발 03. Vertex AI Gemini 둘러보기
Vertex Gemini 기반 AI 에이전트 개발 02. 생성 AI에 대해서
Vertex Gemini 기반 AI 에이전트 개발 01. 소개
Vertex Gemini 기반 AI 에이전트 개발-소개
Archive Posts
Tags
database
mysql
sql
SQL tutorial with MySQL
Copyrights © -
Joinc
, All Rights Reserved.
Inherited From -
Yundream
Rebranded By -
Joonphil
Recent Posts
Archive Posts
Tags