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 Delete Statement
Recommanded
Free
YOUTUBE Lecture:
<% selectedImage[1] %>
yundream
2023-08-14
2022-08-27
1449
# MySQL Delete Statement 모든 쿼리는 연습용 데이터베이스를 통해서 실행해 볼 수 있다. [MySQL & SQL 스터디 준비](https://www.joinc.co.kr/w/mysql_study_ready) 를 참고하여 실습환경을 구축하자. Delete Statement는 테이블에서 데이터를 삭제하기 위해서 사용한다. ### Syntax ```sql DELETE FROM table_name WHERE condition; ``` * table_name : 삭제할 테이블의 이름 * condition : 삭제조건으로 조건이 참(true)인 경우에만 삭제를 수행한다. 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 | Dodswordth 가 해고되어서, 삭제하기로 했다. EmployeeID를 조건으로 삭제해보자. ```sql DELETE FROM employees WHERE EmployeeID = 9; ``` 아래와 같이 WHERE 문을 사용하지 않으면 모든 레코드를 삭제하게 된다. ```sql DELETE FROM employees; ``` ## 참고 [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