2021/02(17)
-
[HackerRank MySQL] Weather Observation Station 20
Weather Observation Station 20 A median is defined as a number separating the higher half of a data set from the lower half. Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to 4 decimal places. Input Format The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. Solution select round(lat_n, 4) from..
2021.02.25 -
[HackerRank MySQL] Occupations
Occupations Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output column headers should be Doctor, Professor, Singer, and Actor, respectively. Note: Print NULL when there are no more names corresponding to an occupation. Input Format The OCCUPATIONS table is described as follows: Occupation will onl..
2021.02.25 -
[HackerRank MySQL Server] Challenges - 서브쿼리 WITH절 활용
Challenges Julia asked her students to create some coding challenges. Write a query to print the hacker_id, name, and the total number of challenges created by each student. Sort your results by the total number of challenges in descending order. If more than one student created the same number of challenges, then sort the result by hacker_id. If more than one student created the same number of ..
2021.02.24 -
[HackerRank MySQL] The PADS
The PADS Generate the following two result sets: 1. Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S). 2. Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurr..
2021.02.23 -
[파이썬 300제 풀기] 021 ~ 030 (파이썬 문자열)
021 문자열 인덱싱 letters가 바인딩하는 문자열에서 첫번째와 세번째 문자를 출력하세요. letters = 'python' print(letters[0], letters[2]) 022 문자열 슬라이싱 자동차 번호가 다음과 같을 때 뒤에 4자리만 출력하세요. license_plate = "24가 2210" print(license_plate[-4:]) 023 문자열 인덱싱 아래의 문자열에서 '홀' 만 출력하세요. # 1 string = "홀짝홀짝홀짝" print(string[0],string[2],string[4],sep='') # 2 string = "홀짝홀짝홀짝" print(string[::2]) 024 문자열 슬라이싱 문자열을 거꾸로 뒤집어 출력하세요. string = "PYTHON" print..
2021.02.22 -
[파이썬 300제 풀기] 011 ~ 020 (파이썬 변수)
011~018 # 011 변수 사용하기 삼성전자 = 50000 총평가금액 = 삼성전자 * 10 print(총평가금액) # 012 변수 사용하기 시가총액 = 2980000000000 현재가 = 50000 PER = 15.79 print(시가총액, 현재가, PER, sep='\n') # 013 문자열 출력 s = "hello" t = "python" print(s+'!', t) # 014 파이썬을 이용한 값 계산 2 + 2 * 3 # => 8 # 015 type 함수 a = 128 print(type(a)) # a = "132" print(type(a)) # # 016 문자열을 정수로 변환 num_str = "720" num_str = int(num_str) print(type(num_str)) # 017 ..
2021.02.22