
SELECT
hd.dept_id
, hd.dept_name_en
, ROUND(AVG(sal), 0) AS AVG_SAL
FROM
hr_department hd
JOIN hr_employees he
USING (dept_id)
GROUP BY
hd.dept_id
, hd.dept_name_en
ORDER BY
AVG_SAL DESC
;
SELECT
route
, CONCAT(ROUND(SUM(d_between_dist), 1), 'km') AS total_distance
, CONCAT(ROUND(AVG(d_between_dist), 2), 'km') AS average_distance
FROM
subway_distance
GROUP BY
route
ORDER BY
total_distance DESC
;
→ 왜 제출에서는 틀렸다고 했을까? ROUND한 값이 동점이었을 때 순서가 안 맞나 보다!
SELECT
route
, CONCAT(ROUND(SUM(d_between_dist), 1), 'km') AS total_distance
, CONCAT(ROUND(AVG(d_between_dist), 2), 'km') AS average_distance
FROM
subway_distance
GROUP BY
route
ORDER BY
SUM(d_between_dist) DESC
;
def solution(s):
s_list = list(map(int, s.split(' ')))
answer = f'{min(s_list)} {max(s_list)}'
return answer
def solution(s):
s = list(map(int,s.split()))
return str(min(s)) + " " + str(max(s))
def solution(s):
t = []
if s[0] != "-":
s = "+" + s
for i in range(0, len(s)):
t += [s[i]]
for i in range(0, len(t)):
if t[i] == " " and t[i+1] != "-":
t.insert(i+1, "+")
for i in range(1, len(t)):
if t[len(t)-i] == " " and t[len(t)+1-i] != "-":
t.insert(len(t)+1-i, "+")
break
print(t)
result = []
midcount1 = ""
midcount2 = ""
for i in range(len(t)):
if t[i] == "-":
for j in range(i+1, len(t)):
if t[j] != " ":
midcount1 = midcount1 + t[j]
if j == len(t)-1:
result += [-int(midcount1)]
midcount1 = ""
break
elif t[j] == " ":
print(midcount1)
result += [-int(midcount1)]
midcount1 = ""
break
elif t[i] == "+":
for j in range(i+1, len(t)):
if t[j] != " ":
midcount2 = midcount2 + t[j]
if j == len(t)-1:
result += [int(midcount2)]
midcount2 = ""
break
elif t[j] == " ":
print(midcount2)
result += [int(midcount2)]
midcount2 = ""
break
print(result)
resultmax = int(result[0])
resultmin = int(result[0])
for i in range(len(result)):
if resultmax < result[i]:
resultmax = result[i]
for i in range(len(result)):
if resultmin > result[i]:
resultmin = result[i]
return "%s %s" % (resultmin, resultmax)
# 1
def solution(s):
s_list=s.split(" ")
n = [int(i) for i in s_list]
n.sort()
return str(n[0]) + " " + str(n[len(n)-1])
# 2
def solution(s):
il = sorted([int(c) for c in s.split(' ')])
answer = ' '.join([str(il[0]), str(il[len(il)-1])])
return answer
# 3
def solution(s):
answer = sorted([int(x) for x in s.split()])
return str(answer[0]) + " " + str(answer[-1])
def solution(s):
return map(lambda x: str(min(x))+" "+str(max(x)), [list(map(int,s.split(" ")))]).__next__()
def solution(s):
answer = ''
s_split = s.split(' ')
for i in range(len(s_split)):
s_split[i] = s_split[i].capitalize()
answer = ' '.join(s_split)
return answer
def solution(s):
import string
return string.capwords(s, ' ')
def solution(s):
answer = ''
for i in s.lower().split(' '):
if answer == '':
answer += i.capitalize()
else:
answer += ' '+i.capitalize()
return answer
포스트맨을 이용하여 API를 실행하고 테스트하는 방법
자신의 계정 로그인 후 Workspaces > My Workspace로 들어가서 원하는 작업 진행
| 요청방식 | URL |
|---|---|
| GET | https://httpbin.org/get |
| POST | https://httpbin.org/post |
| PUT | https://httpbin.org/put |
| DELETE | https://httpbin.org/delete |





body 종류
변수를 환경에 지정해 사용 가능
이터널 리턴 개발자 디스코드








