코딩공부/SQL 4

SQL 4주차

https://teamsparta.notion.site/SQL-60c2a83eecdb473887ba73a75bd1c053 SQL 전체 강의자료 [내일배움단] 엑셀보다 쉬운 SQL 강의자료 teamsparta.notion.site [수업 목표] Subquery(서브쿼리)의 사용 방법을 배워본다 실전에서 유용한 SQL 문법을 더 배워본다 SQL을 사용하여 실전과 같은 데이터분석을 진행해본다 with절 with table1 as ( select course_id, count(distinct(user_id)) as cnt_checkins from checkins group by course_id ), table2 as ( select course_id, count(*) as cnt_total from order..

코딩공부/SQL 2022.10.27

SQL 3주차

3-2강 [Joint을 사용해서 Key값으로 두테이블 연결해보기] select * from point_users left join users on point_users.user_id = users.user_id [유저데이터로 Inner Join 이해해보기] select * from users u inner join point_users p on u.user_id = p.user_id; [과목별 오늘의 다짐 갯수 세어보기] select co.title, count(co.title) as checkin_count from checkins ci inner join courses co on ci.course_id = co.course_id group by co.title [많은 포인트를 얻은 순서대로 유저 데이..

코딩공부/SQL 2022.10.26

SQL 2주차

2-2강 [성씨별 회원수를 Group by로 쉽게 구해보기] select name, count(*) from users group by name; [users 테이블 전체 불러오기] select * from users; [users 테이블에서 '신'씨를 가진 데이터만 불러와서 개수 살펴보기] select * from users where name = "신**"; [group by를 사용해서 '신'씨를 가진 데이터가 몇 개인지 살펴보기] select name, count(*) fro[m users group by name; 2-3강 [주차별 '오늘의 다짐' 개수 구하기] select week, count(*) from checkins group by week; [주차별 '오늘의 다짐'의 좋아요 최소,최대,..

코딩공부/SQL 2022.10.25

SQL 1주차

3강 [스파르타 데이터베이스의 테이블 보기] show tables; [orders 테이블의 특정 필드만 가져와보기] select created_at, course_title, payment_method, email from orders; [orders 테이블의 데이터가져와 보기] select * from orders; 4강 [같지 않음 조건 걸어보기] select * from orders where course_title != "웹개발 종합반"; [범위 조건 걸어보기] select * from orders where created_at between "2020-07-13" and "2020-07-15"; [포함조건 걸어보기] select * from checkins where week in (1, 3);..

코딩공부/SQL 2022.10.24