Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 덴드로그램
- list
- 분류 결과표
- Dictionary
- numpy
- len()
- 최솟값
- function
- append()
- matplotlib
- Python
- pandas
- wcss
- DataFrame
- nan
- dendrogram
- data
- string
- IN
- DataAccess
- hierarchical_clustering
- sklearn
- 최댓값
- count()
- Machine Learning
- 반복문
- elbow method
- del
- insert()
- analizer
Archives
- Today
- Total
개발공부
데이터 조작어 DML (INSERT, UPDATE, DELETE, SELECT) 본문
데이터 조작어 (Data Manupulation Language)
DB에 있는 데이터를 검색, 등록, 삭제, 갱신하기 위한 언어이다.DML로는 INSERT, UPDATE, DELETE, SELECT가 있다.
1. 데이터 등록하기 INSERT
데이터 한개 등록
insert into people
(first_name, last_name, age)
values
('Tina', 'Belcher', 13);
데이터 여러개 등록
insert into people
(first_name, last_name, age)
values
('Linda', 'Belcher', 45),
('Phillips', 'Frond', 38),
('Calvin', 'Fischoeder', 70);
2. 데이터 검색하기 SELECT
해당 테이블의 전체를 검색 *
select * from people;

테이블 내에서 특정조건을 만족하는 것 출력 where
-- age가 45인 행의 first_name만 출력
select first_name from people
where age = 45;

2. 데이터 갱신하기 UPDATE
-- first_name이 Tina인 사람의 나이를 15로 바꾸기
update people
set age = 15
where first_name = 'Tina';
3. 데이터 삭제하기 DELETE
전체 데이터 삭제하기
delete from people;
조건을 만족하는 데이터 삭제하기
-- age가 15인 데이터 삭제
delete from people
where age = 15;'Database > MySQL' 카테고리의 다른 글
| [MySQL] 데이터 중복 없이 선택 distinct, 데이터 정렬 order by (0) | 2022.05.16 |
|---|---|
| [MySQL] 문자열 교체 replace(), 거꾸로 변경 reverse(), 길이 구하기 char_length(), 대소문자 변경 upper(), lower() (0) | 2022.05.16 |
| [MySQL] 문자열의 일부분만 가져오기 substr(), substring() (0) | 2022.05.16 |
| [MYSQL] 컬럼 합치기 concat(), concat_ws() (0) | 2022.05.16 |
| MYSQL Workbench 스키마 생성하기, 테이블 생성하기 (0) | 2022.05.13 |