SQL은 방대한 데이터중에서 필요한 정보만을 가져올 수 있는 아주 좋은 프로그램이다.
1. show- 보여준다.
2. select * from table- 해당 테이블의 전체 필드를 보여준다.
3. where 필드- 해당 데이터에 조건을 걸어준다.
4. != 같지 않음
select * from orders
where course_title != "웹개발 종합반";
웹개발 종합반 이외에 데이터가 추출된다.
5.범위조건-between and
select * from orders
where created_at between "2020-07-13" and "2020-07-15";
6.포함조건 in ( )
select * from checkins
where week in (1, 3);
7.포함 문자열
select * from users
where email like '%daum.net';
8. 카운트- select count( ) from users
9.중복제거- distict
SELECT DISTINCT (payment_method) FROM orders
댓글