2/12 보충
오늘 한 일
- AI 리터리시 (1-5)
[과제] LLM을 통해서 취득하고 싶은 자격증에 대한 요점 요약 핵심 암기노트 만들기
좋아, 컴퓨터활용능력 2급 필기 시험 직전용으로
👉 딱 암기 위주 핵심만 정리해줄게.
✅ 1과목: 컴퓨터 일반
🔹 1. 컴퓨터 구조
▪ CPU 구성
- 제어장치: 명령 해석·통제
- 연산장치(ALU): 산술·논리 연산
- 레지스터: 초고속 기억장치
▪ 기억장치
- RAM: 휘발성
- ROM: 비휘발성
- 캐시: CPU-메모리 속도차 보완
- 가상메모리: HDD 일부를 RAM처럼 사용
👉 속도: 레지스터 > 캐시 > RAM > HDD
🔹 2. 운영체제 (Windows 중심)
▪ 파일 시스템
- NTFS: 보안/압축/암호화 가능
- FAT32: 4GB 이상 파일 저장 불가
▪ 바로가기 키
- Ctrl + Shift + Esc → 작업관리자
- Alt + Tab → 창 전환
- Win + E → 탐색기
- Win + R → 실행창
🔹 3. 인터넷 & 네트워크
- IP 주소: 32비트 (IPv4)
- DNS: 도메인 → IP 변환
- FTP: 파일 전송
- HTTP: 웹 통신
- SMTP: 메일 송신
- POP3: 메일 수신
👉 URL 구조: 프로토콜://도메인/경로
🔹 4. 정보 보안
- 대칭키: 암복호화 동일 키
- 공개키(비대칭키): 암호화·복호화 키 다름
- 악성코드 종류
- 바이러스
- 웜
- 트로이목마
- 랜섬웨어
✅ 2과목: 스프레드시트 일반 (엑셀)
🔹 1. 셀 참조
- 상대참조: A1
- 절대참조: $A$1
- 혼합참조: $A1, A$1
👉 F4 누르면 자동 변경
🔹 2. 자주 나오는 함수 ⭐
▪ 조건
- IF(조건, 참, 거짓)
- COUNTIF
- SUMIF
▪ 개수/합계
- COUNT → 숫자 개수
- COUNTA → 문자 포함 개수
- SUM
- AVERAGE
▪ 찾기
- VLOOKUP
- 무조건 왼쪽 열 기준
- 범위 첫 열에서 찾음
- HLOOKUP → 가로 검색
🔹 3. 정렬 & 필터
- 정렬: 오름차순/내림차순
- 자동필터: 조건별 추출
- 고급필터: 조건범위 따로 설정
🔹 4. 차트
- 데이터 수정 → 차트 자동 반영
- 축 제목, 범례, 데이터 레이블 자주 출제
🔹 5. 기타 자주 출제
- 피벗 테이블: 데이터 요약
- 조건부 서식: 특정 조건 자동 강조
- 매크로
- VBA 기반
- 보안 설정 필요
🎯 시험 직전 암기 포인트
✔ RAM = 휘발성
✔ IPv4 = 32비트
✔ NTFS = 보안 기능 가능
✔ VLOOKUP = 첫 열 기준
✔ COUNT vs COUNTA 구분
✔ 절대참조 = $
- SQL (3-1 ~ 3-8)
3-1 3주차 오늘 배울 것
3-2 업무 필요한 문자 포맷이 다를 때, SQL로 가공하기 (REPLACE, SUBSTRING, CONCAT)
REPLACE : 특정 문자를 다른 것으로 바꿈
replace(바꿀 컬럼, 현재 값, 바꿀 값)
ex) 주소의 '문곡리'를 '문가리'로 바꾸기
select addr "원래 주소",
replace(addr, '문곡리', '문가리') "바뀐 주소"
from food_orders
where addr like '%문곡리%'
SUBSTRING(SUBSTR) : 특정 문자만 골라서 조회
substr(조회 할 컬럼, 시작 위치, 글자 수)
ex) 서울 음식점들의 주소를 전체가 아닌 '시도' 만 나오도록 수정
select addr "원래 주소",
substr(addr, 1, 2) "시도"
from food_orders
where addr like '%서울특별시%'
CONCAT : 여러 컬럼의 값을 하나로 합치기
concat(붙이고 싶은 값1, 붙이고 싶은 값2, 붙이고 싶은 값3, .....)
붙일 수 있는 문자의 종류 : 컬럼 / 한글 / 영어 / 숫자 / 기타 특수문자
ex) 서울시에 있는 음식점을 '[서울]음식점명'이라고 수정
select restaurant_name "원래 이름",
addr "원래 주소",
concat('[', substring(addr, 1, 2), '] ', restaurant_name) "바뀐 이름"
from food_orders
where addr like '%서울%'
3-3 [실습] 문자 데이터를 바꾸고, GROUP BY 사용하기
서울 지역의 음식 타입별 평균 음식 주문금액 구하기 (출력 : ‘서울’, ‘타입’, ‘평균 금액’)
select substring(addr, 1, 2) "시도",
cuisine_type "음식 종류",
avg(price) "평균 금액"
from food_orders
where addr like '%서울%'
group by 1, 2
이메일 도메인별 고객 수와 평균 연령 구하기
select substring(email, 10) "도메인",
count(customer_id) "고객 수",
avg(age) "평균 연령"
from customers
group by 1
'[지역(시도)] 음식점이름 (음식종류)’ 컬럼을 만들고, 총 주문건수 구하기
select concat('[', substring(addr, 1, 2), '] ', restaurant_name, ' (', cuisine_type, ')') "바뀐이름",
count(1) "주문건수"
from food_orders
group by 1
3-4 조건에 따라 포맷을 다르게 변경해야한다면 (IF, CASE)
IF : 원하는 조건에 충족할때 적용할 방법/아닌 방법 지정
if(조건, 조건을 충족할 때, 조건을 충족하지 못할 때)
ex) 음식 타입을 'Korean'일 때는 '한식', 'Korean'이 아닌 경우에는 '기타'라고 지정
select restaurant_name,
cuisine_type "원래 음식 타입",
if(cuisine_type='Korean', '한식', '기타') "음식 타입"
from food_orders
ex) '문곡리'가 평택에만 해당 될 때. 평택 '문곡리'만 '문가리'로 수정
select addr "원래 주소",
if(addr like '%평택군%', replace(addr, '문곡리', '문가리'), addr) "바뀐 주소"
from food_orders
where addr like '%문곡리%'
ex) 잘못된 이메일 주소(gmail)만 수정해서 사용
select substring(if(email like '%gmail%', replace(email, 'gmail', '@gmail'), email), 10) "이메일 도메인",
count(customer_id) "고객 수",
avg(age) "평균 연령"
from customers
group by 1
CASE : 각 조건별로 적용 할 값을 지정
- 조건별로 지정 해주기 때문에 if문을 여러번 쓴 효과를 낼 수 있다.
case when 조건1 then 값(수식)1
when 조건2 then 값(수식)2
else 값(수식)3
end
ex) 주소의 시도를 '경기도'일때는 '경기도', '특별시' 혹은 '광역시' 일 때는 붙여서, 아닐 때는 앞의 두 글자만 사용
select restaurant_name,
addr,
case when addr like '%경기도%' then '경기도'
when addr like '%특별%' or addr like '%광역%' then substring(addr, 1, 5)
else substring(addr, 1, 2) end "변경된 주소"
from food_orders
3-5 [실습] SQL로 간단한 User Segmentation 해보기
10세 이상, 30세 미만의 고객의 나이와 성별로 그룹 나누기(이름도 같이 출력)
select name,
age,
gender,
case when (age between 10 and 19) and gender='male' then "10대 남자"
when (age between 10 and 19) and gender='female' then "10대 여자"
when (age between 20 and 29) and gender='male' then "20대 남자"
when (age between 20 and 29) and gender='female' then "20대 여자" end "그룹"
from customers
where age between 10 and 29
음식 단가, 음식 종류 별로 음식점 그룹 나누기
select restaurant_name,
price/quantity "단가",
cuisine_type,
order_id,
case when (price/quantity <5000) and cuisine_type='Korean' then '한식1'
when (price/quantity between 5000 and 15000) and cuisine_type='Korean' then '한식2'
when (price/quantity > 15000) and cuisine_type='Korean' then '한식3'
when (price/quantity <5000) and cuisine_type in ('Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '아시아식1'
when (price/quantity between 5000 and 15000) and cuisine_type in ('Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '아시아식2'
when (price/quantity > 15000) and cuisine_type in ('Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '아시아식3'
when (price/quantity <5000) and cuisine_type not in ('Korean', 'Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '기타1'
when (price/quantity between 5000 and 15000) and cuisine_type not in ('Korean', 'Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '기타2'
when (price/quantity > 15000) and cuisine_type not in ('Korean', 'Japanese', 'Chinese', 'Thai', 'Vietnamese', 'Indian') then '기타3' end "식당 그룹"
from food_orders
3-6 [실습] 조건문으로 서로 다른 식을 적용한 수수료 구해보기
지역과 배달시간을 기반으로 배달 수수료 구하기(식당 이름, 주문 번호 함께 출력)
select restaurant_name,
order_id,
delivery_time,
price,
addr,
case when delivery_time>25 and delivery_time<=30 then price*0.05*(if(addr like '%서울%', 1.1, 1))
when delivery_time>30 then price*1.1*(if(addr like '%서울%', 1.1, 1))
else 0 end "수수료"
from food_orders
주문 시기와 음식 수를 기반으로 배달할증료 구하기
select order_id,
price,
quantity,
day_of_the_week,
if(day_of_the_week='Weekday', 3000, 3500)*(if(quantity<=3, 1, 1.2)) "할증료"
from food_orders
3-7 SQL문에 문제가 없는 것 같은데 왜 오류가 나나요_(Data Type 오류 해결하기)
문자, 숫자 데이터가 섞여 있으면 연산이 안 될 수 있다.
--숫자로 변경
cast(if(rating='Not given', '1', rating) as decimal)
--문자로 변경
concat(restaurant_name, '-', cast(order_id as char))
3-8 실습문제
배달시간이 늦었는지 판단하는 값을 만들기
select order_id,
restaurant_name,
day_of_the_week,
delivery_time,
case when day_of_the_week='weekday' then if(delivery_time>=25,'Late' , 'On-time')
when day_of_the_week='weekend' then if(delivery_time>=30,'Late' , 'On-time')
end '지연여부'
from food_orders
'내일배움캠프(사전캠프)' 카테고리의 다른 글
| [내일배움캠프] 사전캠프 (6일차) (0) | 2026.02.23 |
|---|---|
| [내일배움캠프] 사전캠프 (5일차) (0) | 2026.02.23 |
| [내일배움캠프] 사전캠프 (3일차) (0) | 2026.02.11 |
| [내일배움캠프] 사전캠프 (2일차) (0) | 2026.02.10 |
| [내일배움캠프] 사전캠프 (1일차) (0) | 2026.02.09 |