상세 컨텐츠

본문 제목

[MySQL] DBeaver | Insert | Update | Delete

IT/DataBase

by o_zeew 2024. 4. 30. 17:47

본문

24.04.30 52일차

 

https://dbeaver.io/

 

DBeaver Community | Free Universal Database Tool

DBeaver Universal Database Tool DBeaver Community is a free cross-platform database tool for developers, database administrators, analysts, and everyone working with data. It supports all popular SQL databases like MySQL, MariaDB, PostgreSQL, SQLite, Apach

dbeaver.io

gui tool(client tool)

홈화면
driver setting
설정 완료

 

사용하기 > 블록 잡아서 ctrl+enter

 


group by

부서별 직원수를 조회

select officeCode, count(officeCode) > count(officeCode)는 officeCode가 null값이 아닌 것만 count

직무별 직원수를 조회

국가별 고객수를 조회

국가별 고객수를 조회

신용한도액이 100,000원 이상인 고객들의 수를 국가별로 조회

2005년에 주문된 정보를 현재 상태별 건수를 조회

year()='년도' : 특정 년도만 검색

 

합계 = sum(amount)

별칭 = as ' '

" " 안에 별칭을 바로 입력할 수 있음

order by : 정렬

 

 


where절과 having의 차이점

 

where : select문장이 실행되기 전에 조건에 맞는 데이터를 먼저 필터링.

having : group by 절에 의해서 묶여진 데이터의 결과값에 필터링.

 


Insert

 

 


Update

where 절이 생략되면 모든 행에 수정이 적용됨으로 주의해야함

null값이 존재하는 행을 하나씩 확인하며 수정

 

commit 후에는 다른 곳에서도 확인 가능(cmd창)

 

 


Delete

관련글 더보기