Skip to content

Commit 07ace1c

Browse files
committed
[level 1] Title: 경기도에 위치한 식품창고 목록 출력하기, Time: 0.00 ms, Memory: 0.0 MB -BaekjoonHub
1 parent 5dfeddf commit 07ace1c

File tree

2 files changed

+149
-0
lines changed

2 files changed

+149
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# [level 1] 경기도에 위치한 식품창고 목록 출력하기 - 131114
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/131114)
4+
5+
### 성능 요약
6+
7+
메모리: 0.0 MB, 시간: 0.00 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > IS NULL
12+
13+
### 채점결과
14+
15+
Empty
16+
17+
### 제출 일자
18+
19+
2026년 03월 01일 23:03:26
20+
21+
### 문제 설명
22+
23+
<p>다음은 식품창고의 정보를 담은 <code>FOOD_WAREHOUSE</code> 테이블입니다. <code>FOOD_WAREHOUSE</code> 테이블은 다음과 같으며 <code>WAREHOUSE_ID</code>, <code>WAREHOUSE_NAME</code>, <code>ADDRESS</code>, <code>TLNO</code>, <code>FREEZER_YN</code>는 창고 ID, 창고 이름, 창고 주소, 전화번호, 냉동시설 여부를 의미합니다.</p>
24+
<table class="table">
25+
<thead><tr>
26+
<th>Column name</th>
27+
<th>Type</th>
28+
<th>Nullable</th>
29+
</tr>
30+
</thead>
31+
<tbody><tr>
32+
<td>WAREHOUSE_ID</td>
33+
<td>VARCHAR(10)</td>
34+
<td>FALSE</td>
35+
</tr>
36+
<tr>
37+
<td>WAREHOUSE_NAME</td>
38+
<td>VARCHAR(20)</td>
39+
<td>FALSE</td>
40+
</tr>
41+
<tr>
42+
<td>ADDRESS</td>
43+
<td>VARCHAR(100)</td>
44+
<td>TRUE</td>
45+
</tr>
46+
<tr>
47+
<td>TLNO</td>
48+
<td>VARCHAR(20)</td>
49+
<td>TRUE</td>
50+
</tr>
51+
<tr>
52+
<td>FREEZER_YN</td>
53+
<td>VARCHAR(1)</td>
54+
<td>TRUE</td>
55+
</tr>
56+
</tbody>
57+
</table>
58+
<hr>
59+
60+
<h5>문제</h5>
61+
62+
<p><code>FOOD_WAREHOUSE</code> 테이블에서 경기도에 위치한 창고의 ID, 이름, 주소, 냉동시설 여부를 조회하는 SQL문을 작성해주세요. 이때 냉동시설 여부가 NULL인 경우, 'N'으로 출력시켜 주시고 결과는 창고 ID를 기준으로 오름차순 정렬해주세요.</p>
63+
64+
<hr>
65+
66+
<h5>예시</h5>
67+
68+
<p><code>FOOD_WAREHOUSE</code> 테이블이 다음과 같을 때</p>
69+
<table class="table">
70+
<thead><tr>
71+
<th>WAREHOUSE_ID</th>
72+
<th>WAREHOUSE_NAME</th>
73+
<th>ADDRESS</th>
74+
<th>TLNO</th>
75+
<th>FREEZER_YN</th>
76+
</tr>
77+
</thead>
78+
<tbody><tr>
79+
<td>WH0001</td>
80+
<td>창고_경기1</td>
81+
<td>경기도 안산시 상록구 용담로 141</td>
82+
<td>031-152-1332</td>
83+
<td>Y</td>
84+
</tr>
85+
<tr>
86+
<td>WH0002</td>
87+
<td>창고_충북1</td>
88+
<td>충청북도 진천군 진천읍 씨제이로 110</td>
89+
<td>043-623-9900</td>
90+
<td>Y</td>
91+
</tr>
92+
<tr>
93+
<td>WH0003</td>
94+
<td>창고_경기2</td>
95+
<td>경기도 이천시 마장면 덕평로 811</td>
96+
<td>031-221-7241</td>
97+
<td>NULL</td>
98+
</tr>
99+
<tr>
100+
<td>WH0004</td>
101+
<td>창고_경기3</td>
102+
<td>경기도 김포시 대곶면 율생중앙로205번길</td>
103+
<td>031-671-1900</td>
104+
<td>N</td>
105+
</tr>
106+
<tr>
107+
<td>WH0005</td>
108+
<td>창고_충남1</td>
109+
<td>충청남도 천안시 동남구 광덕면 신덕리1길 9</td>
110+
<td>041-876-5421</td>
111+
<td>Y</td>
112+
</tr>
113+
</tbody>
114+
</table>
115+
<p>SQL을 실행하면 다음과 같이 출력되어야 합니다.</p>
116+
<table class="table">
117+
<thead><tr>
118+
<th>WAREHOUSE_ID</th>
119+
<th>WAREHOUSE_NAME</th>
120+
<th>ADDRESS</th>
121+
<th>FREEZER_YN</th>
122+
</tr>
123+
</thead>
124+
<tbody><tr>
125+
<td>WH0001</td>
126+
<td>창고_경기1</td>
127+
<td>경기도 안산시 상록구 용담로 141</td>
128+
<td>Y</td>
129+
</tr>
130+
<tr>
131+
<td>WH0003</td>
132+
<td>창고_경기2</td>
133+
<td>경기도 이천시 마장면 덕평로 811</td>
134+
<td>N</td>
135+
</tr>
136+
<tr>
137+
<td>WH0004</td>
138+
<td>창고_경기3</td>
139+
<td>경기도 김포시 대곶면 율생중앙로205번길</td>
140+
<td>N</td>
141+
</tr>
142+
</tbody>
143+
</table>
144+
145+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS, IFNULL(FREEZER_YN, 'N') AS FREEZER_YN
2+
FROM FOOD_WAREHOUSE
3+
WHERE ADDRESS LIKE '경기%'
4+
ORDER BY WAREHOUSE_ID;

0 commit comments

Comments
 (0)