SQL 숫자 연산식
+(더하기), - (빼기), * (곱하기), / (나누기)
SUM(컬럼a) a 컬럼의 합계 구하는 구문
AVG(컬럼a) a 컬럼의 평균 구하는 구문
COUNT(컬럼) 테이블이 몇 개의 데이터를 갖고있는지 구하는 구문/ 컬럼 대신 별표나 1 사용 가능
COUNT(distinct 컬럼) 중복을 제외한 값을 구하는 구문
MIN(컬럼) 컬럼의 최솟값을 구하는 구문
MAX(컬럼) 컬럼의 최댓값을 구하는 구문
GROUP BY 컬럼 그룹 지정해주는 구문 ex 식당별로, 성별별로
ORDER BY 컬럼 순차적으로 정렬해주는 구문/ 오름차순이 기본, 내림차순은 컬럼 뒤에 desc
문자 다듬기
replace(바꿀 컬럼, 현재값, 바꿀값) 문자를 일괄적으로 변경하는 구문
EX. replace(name, kim, hong) 이름의 김을 모두 홍으로 변경
SQL 문제 1.
1.
select name,
position
from sparta_employees
2.
select distinct position
from sparta_employees
3.
select
from sparta_employees
where salary between 40000 and 60000
4.
select
from sparta_employees
where hire_date<'2023-01-01'
SQL 문제 2.
1)
select product_name,
price
from products
2)
select
from products
where product_name like '%프로%'
3)
select
from products
where product_name like '갤%'
4)
select sum(price) '총 구매금액'
from products
SQL 문제 3.
1)
select customer_id
from orders
where amount>=2
2)
select *
from orders
where order_date>'2023-11-02' and amount>=2
3)
select *
from orders
where amount<3 and shipping_fee>15000
4)
select *
from orders
order by shipping_fee desc
SQL 문제 4.
1)
select name,
track
from sparta_students
2)
select *
from sparta_students
where not track='Unity'
3)
select *
from sparta_students
where enrollment_year in (2021,2023)
4)
select enrollment_year
from sparta_students
where track='Node.js' and grade='A'
두 번째 아티클
https://brunch.co.kr/@ashashash/19
천상 문과 마케터가 데이터를 분석하며 알게 된 것들
[주제]
마케터의 데이터 분석 경험칙
[아티클 요약]
마케터에게 데이터는 제품 개선과 매출 증진을 위한 중요한 지표.
논리적인 사고 방식으로 고객 입장에서의 합리적인 가설과 행동방안을 이끌어내야함.
데이터 툴 활용보다 데이터 해석과 활용 능력이 우선시
인사이트를 도출해냈으면 답인지 확인하기 위해 인사이트 기반 개선 방안 실행이 필요. (원인을 찾았으면 결과까지 실행하기)
작은 인사이트들이 모여서 큰 인사이트가 됨 (MZ세대와 1020세대와 같은 사소한 소재의 차이도 눈여겨보기)
GOAL 지표와 ASSIST 지표에 집중하기
정량적인 데이터를 믿기. 과거의 경험이 이젠 틀릴 수 있다는 생각 열어두기
[인사이트]