Skip to content

Commit f8cd2b3

Browse files
committed
[level 2] Title: 조건에 맞는 개발자 찾기, Time: , Memory: undefined -BaekjoonHub
1 parent bf883cc commit f8cd2b3

File tree

2 files changed

+245
-0
lines changed

2 files changed

+245
-0
lines changed
Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# [level 2] 조건에 맞는 개발자 찾기 - 276034
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/276034)
4+
5+
### 성능 요약
6+
7+
메모리: undefined, 시간:
8+
9+
### 구분
10+
11+
코딩테스트 연습 > SELECT
12+
13+
### 채점결과
14+
15+
합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2026년 02월 25일 21:27:53
20+
21+
### 문제 설명
22+
23+
<p><code>SKILLCODES</code> 테이블은 개발자들이 사용하는 프로그래밍 언어에 대한 정보를 담은 테이블입니다. <code>SKILLCODES</code> 테이블의 구조는 다음과 같으며, <code>NAME</code>, <code>CATEGORY</code>, <code>CODE</code>는 각각 스킬의 이름, 스킬의 범주, 스킬의 코드를 의미합니다. 스킬의 코드는 2진수로 표현했을 때 각 bit로 구분될 수 있도록 2의 제곱수로 구성되어 있습니다.</p>
24+
<table class="table">
25+
<thead><tr>
26+
<th>NAME</th>
27+
<th>TYPE</th>
28+
<th>UNIQUE</th>
29+
<th>NULLABLE</th>
30+
</tr>
31+
</thead>
32+
<tbody><tr>
33+
<td>NAME</td>
34+
<td>VARCHAR(N)</td>
35+
<td>Y</td>
36+
<td>N</td>
37+
</tr>
38+
<tr>
39+
<td>CATEGORY</td>
40+
<td>VARCHAR(N)</td>
41+
<td>N</td>
42+
<td>N</td>
43+
</tr>
44+
<tr>
45+
<td>CODE</td>
46+
<td>INTEGER</td>
47+
<td>Y</td>
48+
<td>N</td>
49+
</tr>
50+
</tbody>
51+
</table>
52+
<p><code>DEVELOPERS</code> 테이블은 개발자들의 프로그래밍 스킬 정보를 담은 테이블입니다. <code>DEVELOPERS</code> 테이블의 구조는 다음과 같으며, <code>ID</code>, <code>FIRST_NAME</code>, <code>LAST_NAME</code>, <code>EMAIL</code>, <code>SKILL_CODE</code>는 각각 개발자의 ID, 이름, 성, 이메일, 스킬 코드를 의미합니다. <code>SKILL_CODE</code> 컬럼은 INTEGER 타입이고, 2진수로 표현했을 때 각 bit는 <code>SKILLCODES</code> 테이블의 코드를 의미합니다.</p>
53+
<table class="table">
54+
<thead><tr>
55+
<th>NAME</th>
56+
<th>TYPE</th>
57+
<th>UNIQUE</th>
58+
<th>NULLABLE</th>
59+
</tr>
60+
</thead>
61+
<tbody><tr>
62+
<td>ID</td>
63+
<td>VARCHAR(N)</td>
64+
<td>Y</td>
65+
<td>N</td>
66+
</tr>
67+
<tr>
68+
<td>FIRST_NAME</td>
69+
<td>VARCHAR(N)</td>
70+
<td>N</td>
71+
<td>Y</td>
72+
</tr>
73+
<tr>
74+
<td>LAST_NAME</td>
75+
<td>VARCHAR(N)</td>
76+
<td>N</td>
77+
<td>Y</td>
78+
</tr>
79+
<tr>
80+
<td>EMAIL</td>
81+
<td>VARCHAR(N)</td>
82+
<td>Y</td>
83+
<td>N</td>
84+
</tr>
85+
<tr>
86+
<td>SKILL_CODE</td>
87+
<td>INTEGER</td>
88+
<td>N</td>
89+
<td>N</td>
90+
</tr>
91+
</tbody>
92+
</table>
93+
<p>예를 들어 어떤 개발자의 <code>SKILL_CODE</code>가 400 (=b'110010000')이라면, 이는 <code>SKILLCODES</code> 테이블에서 CODE가 256 (=b'100000000'), 128 (=b'10000000'), 16 (=b'10000') 에 해당하는 스킬을 가졌다는 것을 의미합니다.</p>
94+
95+
<hr>
96+
97+
<h5>문제</h5>
98+
99+
<p><code>DEVELOPERS</code> 테이블에서 Python이나 C# 스킬을 가진 개발자의 정보를 조회하려 합니다. 조건에 맞는 개발자의 ID, 이메일, 이름, 성을 조회하는 SQL 문을 작성해 주세요.</p>
100+
101+
<p>결과는 ID를 기준으로 오름차순 정렬해 주세요.</p>
102+
103+
<hr>
104+
105+
<h5>예시</h5>
106+
107+
<p>예를 들어 <code>SKILLCODES</code> 테이블이 다음과 같고,</p>
108+
<table class="table">
109+
<thead><tr>
110+
<th>NAME</th>
111+
<th>CATEGORY</th>
112+
<th>CODE</th>
113+
</tr>
114+
</thead>
115+
<tbody><tr>
116+
<td>C++</td>
117+
<td>Back End</td>
118+
<td>4</td>
119+
</tr>
120+
<tr>
121+
<td>JavaScript</td>
122+
<td>Front End</td>
123+
<td>16</td>
124+
</tr>
125+
<tr>
126+
<td>Java</td>
127+
<td>Back End</td>
128+
<td>128</td>
129+
</tr>
130+
<tr>
131+
<td>Python</td>
132+
<td>Back End</td>
133+
<td>256</td>
134+
</tr>
135+
<tr>
136+
<td>C#</td>
137+
<td>Back End</td>
138+
<td>1024</td>
139+
</tr>
140+
<tr>
141+
<td>React</td>
142+
<td>Front End</td>
143+
<td>2048</td>
144+
</tr>
145+
<tr>
146+
<td>Vue</td>
147+
<td>Front End</td>
148+
<td>8192</td>
149+
</tr>
150+
<tr>
151+
<td>Node.js</td>
152+
<td>Back End</td>
153+
<td>16384</td>
154+
</tr>
155+
</tbody>
156+
</table>
157+
<p><code>DEVELOPERS</code> 테이블이 다음과 같다면</p>
158+
<table class="table">
159+
<thead><tr>
160+
<th>ID</th>
161+
<th>FIRST_NAME</th>
162+
<th>LAST_NAME</th>
163+
<th>EMAIL</th>
164+
<th>SKILL_CODE</th>
165+
</tr>
166+
</thead>
167+
<tbody><tr>
168+
<td>D165</td>
169+
<td>Jerami</td>
170+
<td>Edwards</td>
171+
<td><code>jerami_edwards@grepp.co</code></td>
172+
<td>400</td>
173+
</tr>
174+
<tr>
175+
<td>D161</td>
176+
<td>Carsen</td>
177+
<td>Garza</td>
178+
<td><code>carsen_garza@grepp.co</code></td>
179+
<td>2048</td>
180+
</tr>
181+
<tr>
182+
<td>D164</td>
183+
<td>Kelly</td>
184+
<td>Grant</td>
185+
<td><code>kelly_grant@grepp.co</code></td>
186+
<td>1024</td>
187+
</tr>
188+
<tr>
189+
<td>D163</td>
190+
<td>Luka</td>
191+
<td>Cory</td>
192+
<td><code>luka_cory@grepp.co</code></td>
193+
<td>16384</td>
194+
</tr>
195+
<tr>
196+
<td>D162</td>
197+
<td>Cade</td>
198+
<td>Cunningham</td>
199+
<td><code>cade_cunningham@grepp.co</code></td>
200+
<td>8452</td>
201+
</tr>
202+
</tbody>
203+
</table>
204+
<p>다음과 같이 <code>DEVELOPERS</code> 테이블에 포함된 개발자 중 Python 스킬이나 C# 스킬을 가진 개발자의 정보가 결과에 나와야 합니다.</p>
205+
<table class="table">
206+
<thead><tr>
207+
<th>ID</th>
208+
<th>EMAIL</th>
209+
<th>FIRST_NAME</th>
210+
<th>LAST_NAME</th>
211+
</tr>
212+
</thead>
213+
<tbody><tr>
214+
<td>D162</td>
215+
<td><code>cade_cunningham@grepp.co</code></td>
216+
<td>Cade</td>
217+
<td>Cunningham</td>
218+
</tr>
219+
<tr>
220+
<td>D164</td>
221+
<td><code>kelly_grant@grepp.co</code></td>
222+
<td>Kelly</td>
223+
<td>Grant</td>
224+
</tr>
225+
<tr>
226+
<td>D165</td>
227+
<td><code>jerami_edwards@grepp.co</code></td>
228+
<td>Jerami</td>
229+
<td>Edwards</td>
230+
</tr>
231+
</tbody>
232+
</table>
233+
<ul>
234+
<li>D162번 개발자의 경우 SKILL_CODE가 8452 = 8192 + 256 +4 로 Vue, <strong>Python</strong>, Cpp 스킬을 보유하고 있습니다.</li>
235+
<li>D164번 개발자의 경우 SKILL_CODE가 1024 로 <strong>C#</strong> 스킬을 보유하고 있습니다.</li>
236+
<li>D165번 개발자의 경우 SKILL_CODE가 400 = 256 + 128 + 16 으로 <strong>Python</strong>, Java, JavaScript 스킬을 보유하고 있습니다.</li>
237+
</ul>
238+
239+
240+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT ID, EMAIL, FIRST_NAME, LAST_NAME
2+
FROM DEVELOPERS
3+
WHERE SKILL_CODE & (SELECT CODE FROM SKILLCODES WHERE NAME = 'Python')
4+
OR SKILL_CODE & (SELECT CODE FROM SKILLCODES WHERE NAME = 'C#')
5+
ORDER BY ID;

0 commit comments

Comments
 (0)