[TIL] SQL

라형선·2023년 5월 11일
0

SQL

데이터베이스를 설계하는 사람이 아니기 때문에 잘 가져오는 부분을 연습할 예정이다.
데이터베이스를 왜 사용하는가?
책장을 예로들어 보자 왜 책장을 사용할까? 쌓아두려고 ? 아니다 책을 잘 정리하고 잘 원할때 쉽고 빠르게 꺼내오기 위해서이다.

Table/Field 이 존재한다.

show table + (ctrl + enter)[실행]
slect * from USERS
where Student = '3-1' and sex = 'fFemale'
between '2020-07-08' and '2020-08-08'
where week in (1,3) // 1또는 3
where email like '%daum.net'
limit

select distinct(pament_method) from order //중복을 제거

select count(*) from orders//갯수

select count(distinct(name)) from order // 중복을 제거한 이름이 몇개인지 알려 준다.

profile
형선

0개의 댓글