PageSourceSearch

https://sql-modeling-ai.vercel.app/_next/static/chunks/pages/sql-modeling-ai/5-3-exercises-3cc32c610c7984b4.js

js sql-modeling-ai.vercel.app collected 2026-10-03 07:48:18 UTC 10,096 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9188],{83108:function(s,i,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sql-modeling-ai/5-3-exercises",function(){return e(95198)}])},95198:function(s,i,e){"use strict";e.r(i),e.d(i,{useTOC:function(){return a}});var n=e(52676),l=e(22763),h=e(61347),r=e(71388),d=e(41030);function a(s){return[{value:"풀기 전에 — 오늘의 무기 점검",id:"풀기-전에--오늘의-무기-점검",depth:2},{value:"문제 1. 가장 어린 회원 3명",id:"문제-1-가장-어린-회원-3명",depth:2},{value:"문제 2. 카테고리 + 가격 다중 정렬",id:"문제-2-카테고리--가격-다중-정렬",depth:2},{value:"문제 3 (도전). 비싼 상품 6위 ~ 10위",id:"문제-3-도전-비싼-상품-6위--10위",depth:2}]}i.default=(0,l.c)(function(s){let{toc:i=a(s)}=s,e={br:"br",code:"code",details:"details",em:"em",h2:"h2",p:"p",pre:"pre",span:"span",strong:"strong",summary:"summary",...(0,r.a)(),...s.components};return(0,n.jsxs)("div",{className:"ls",children:[(0,n.jsx)(d.K1,{kicker:"테크타니 LEARN — 섹션 05 \xb7 연습 문제",title:(0,n.jsxs)(n.Fragment,{children:["5-3 연습 문제 —",(0,n.jsx)(e.br,{}),(0,n.jsx)(e.span,{className:"ls-hl",children:"줄 세우고, 끊어서 가져오기"})]}),lead:(0,n.jsx)(n.Fragment,{children:"영상을 봤다고 끝이 아닙니다. 직접 짜본 SQL 만 머리에 남습니다. ORDER BY 로 정렬하고 LIMIT 으로 끊어내는 — 랭킹 만들기 3문제입니다."}),chips:[{k:"문제",v:"3문제 (도전 1 포함)"},{k:"권장 소요",v:"15분"},{k:"사용 테이블",v:"members \xb7 products"},{k:"범위",v:"ORDER BY / LIMIT / OFFSET"}]}),(0,n.jsx)(d.Mk,{tone:"good",label:"AI 과외 선생님 활용법",children:(0,n.jsxs)(e.p,{children:["2-4에서 만든 ",(0,n.jsx)(e.strong,{children:"AI 과외 선생님 세션"}),"을 그대로 쓰세요. 막히면 정답이 아니라\n",(0,n.jsx)(e.em,{children:"“힌트만 줘”"})," — 그리고 다 푼 뒤에는 ",(0,n.jsx)(e.strong,{children:"본인 SQL 과 실행 결과를 던지고"})," ",(0,n.jsx)(e.em,{children:"“이\n결과가 맞는지 검증해줘”"})," 라고 물어보세요. 이게 이 강의의 메인 메시지(AI 와\n협업하는 SQL 학습)의 실제 훈련입니다."]})}),(0,n.jsx)(e.h2,{id:i[0].id,children:i[0].value}),(0,n.jsx)(d.o4,{items:[{label:"5-1 ~ 5-2",sub:"완료 ✓"},{label:"5-3 ORDER BY / LIMIT",sub:"완료 ✓"},{label:"5-3 연습 문제",sub:"지금 여기",now:!0},{label:"5-4 GROUP BY",sub:'"~별" 사고법'}]}),(0,n.jsx)(d.Tz,{title:"이번 강의에서 배운 것 — 이 3개만 있으면 다 풉니다",items:[(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.code,{children:"ORDER BY"})," — ASC/DESC, 다중 정렬"]},"1"),(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.code,{children:"LIMIT"})," — 위에서 N 개만 끊어오기"]},"2"),(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.code,{children:"OFFSET"})," — M 개 건너뛰고 시작"]},"3")]}),(0,n.jsx)(e.h2,{id:i[1].id,children:i[1].value}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.code,{children:"members"})," 에서 — ",(0,n.jsx)(e.strong,{children:"나이가 가장 어린 회원 3명"})," 의 이름과 나이."]}),(0,n.jsx)(d.wU,{title:"기대 결과 — 3행",cols:["member_name","age"],rows:[["백서윤  ← 첫 줄",21],["?","?"],["?","?"]],note:"3 rows"}),(0,n.jsxs)(e.details,{children:[(0,n.jsx)(e.summary,{children:"정답 보기"}),(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"sql","data-word-wrap":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"SELECT"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  member_name,"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  age"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"FROM"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  members"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"ORDER BY"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  age "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"ASC"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"LIMIT"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 3"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})]})})]}),(0,n.jsx)(e.h2,{id:i[2].id,children:i[2].value}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.code,{children:"products"})," 를 — ",(0,n.jsx)(e.strong,{children:"카테고리 오름차순으로"}),", ",(0,n.jsx)(e.strong,{children:"같은 카테고리 안에선 가격 내림차순"})," 으로 정렬."]}),(0,n.jsx)(d.wU,{title:"기대 결과 — 30행",cols:["product_name","price","category_id"],rows:[["패딩 점퍼  ← 의류 중 가장 비싼 것부터",129e3,1],["…","…","…"]],note:"30 rows"}),(0,n.jsxs)(e.details,{children:[(0,n.jsx)(e.summary,{children:"정답 보기"}),(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"sql","data-word-wrap":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"SELECT"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"  *"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"FROM"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  products"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"ORDER BY"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"}
1,children:"  category_id "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"ASC"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:","})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  price "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"DESC"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})]})})]}),(0,n.jsx)(e.h2,{id:i[3].id,children:i[3].value}),(0,n.jsxs)(e.p,{children:["상품을 ",(0,n.jsx)(e.strong,{children:"가격 내림차순으로 정렬했을 때 — 6위부터 10위까지"})," 만 출력."]}),(0,n.jsxs)(e.p,{children:[(0,n.jsx)(e.strong,{children:"기대 결과"}),": 5행 (1~5위는 건너뜀)"]}),(0,n.jsx)(d.zF,{title:"머릿속 그림 — 랭킹에서 가운데만 잘라내기",lines:[{s:"가격 내림차순 전체 랭킹 (30행)"},{s:""},{s:" 1위 ~  5위  → 건너뛴다"},{t:"hl",s:" 6위 ~ 10위  → 이 5행만 출력"},{s:"11위 ~ 30위  → 잘라낸다"}]}),(0,n.jsxs)(d.Mk,{label:"힌트",children:[(0,n.jsx)(e.code,{children:"LIMIT N OFFSET M"})," — M 개 건너뛰고 N 개."]}),(0,n.jsxs)(e.details,{children:[(0,n.jsx)(e.summary,{children:"정답 보기"}),(0,n.jsx)(e.pre,{tabIndex:"0","data-language":"sql","data-word-wrap":"",children:(0,n.jsxs)(e.code,{children:[(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"SELECT"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  product_name,"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  price"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"FROM"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  products"})}),"\n",(0,n.jsx)(e.span,{children:(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"ORDER BY"})}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  price "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"DESC"})]}),"\n",(0,n.jsxs)(e.span,{children:[(0,n.jsx)(e.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"LIMIT"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" 5"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" OFFSET "}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"5"}),(0,n.jsx)(e.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:";"})]})]})})]}),(0,n.jsxs)(e.p,{children:["3문제 모두 직접 돌려봤다면 — 줄 세우기는 끝났습니다. 다음은 데이터를 ",(0,n.jsx)(e.strong,{children:"“~별” 로 묶어서 요약하는"})," GROUP BY 입니다."]}),(0,n.jsx)(d.dS,{href:"/sql-modeling-ai/5-4-group-by",title:'5-4 GROUP BY — "~별" 사고법',note:"회원별\xb7카테고리별\xb7날짜별 — 묶어서 집계하는 사고법을 배웁니다.",btn:"다음 강의 시작하기"})]})},"/sql-modeling-ai/5-3-exercises",{filePath:"pages/sql-modeling-ai/5-3-exercises.mdx",timestamp:1784216581e3,pageMap:h.v,frontMatter:{},title:"5 3 Exercises"},"undefined"==typeof RemoteContent?a:RemoteContent.useTOC)}},function(s){s.O(0,[2763,8098,2888,9774,179],function(){return s(s.s=83108)}),_N_E=s.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.