분류 전체보기 35

[해커랭크] MySQL 숫자를 문자로 변환하기(CAST) - The Blunder

The Blunder | HackerRank Query the amount of error in Sam's result, rounded up to the next integer. www.hackerrank.com 점점 문제가 길어지고 영어 공부도 같이 하는 것 같습니다 :) 이번 문제는 Samatha라는 직원이 전 직원의 평균 급여를 계산하고 있는데 숫자 '0'키가 고장났다는 상황을 가정하여 실제 평균급여와 '0'을 누르지 못했을 때의 평균급여 금액의 차이를 구하는 문제입니다. 문제) Samantha was tasked with calculating the average monthly salaries for all employees in the EMPLOYEES table, but did not real..

[해커랭크] MySQL concat 구문 - The PADS

The PADS | HackerRank Query the name and abbreviated occupation for each person in OCCUPATIONS. www.hackerrank.com 해커랭크에서 처음 만나는 Medium 난이도의 문제였습니다. 크게 어려운 부분은 없긴했지만 union을 사용하다가 오래 걸렸네요..(사실 union을 사용할 필요는 없었습니다) 이번 해커랭크 문제는 2개의 문제가 주어졌습니다. 문제) Generate the following two result sets: 1. Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of..

[해커랭크] MySQL CASE 구문 - Type of Triangle

Type of Triangle | HackerRank Query a triangle's type based on its side lengths. www.hackerrank.com 이번 문제는 삼각형의 유형을 출력하는 문제입니다. 문제) Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table: Equilateral: It's a triangle with 3 sides of equal length. Isosceles: It's a triangle with 2 s..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 12

Weather Observation Station 12 | HackerRank Query an alphabetically ordered list of CITY names not starting and ending with vowels. www.hackerrank.com 이번 문제는 모음으로 시작하지 않고 모음으로 끝나지 않는 도시이름을 출력하는 문제입니다. [Weather Observation Station 11] 문제와 다르게 이번엔 or 조건이 아닌 and 조건입니다. 문제) Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain ..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 11

Weather Observation Station 11 | HackerRank Query a list of CITY names not starting or ending with vowels. www.hackerrank.com 이번 문제는 모음으로 시작하지 않거나 모음으로 끝나지 않는 도시 이름을 출력하는 문제입니다. 문제) Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates. 기존에 사용했던 정규표현식을 그대로 활용하면 될 것 같습니다. select distinct city from station wh..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 9

https://www.hackerrank.com/challenges/weather-observation-station-9/problem Weather Observation Station 9 | HackerRank Query an alphabetically ordered list of CITY names not starting with vowels. www.hackerrank.com 어김없이 SQL 정규표현식 문제입니다. 문제) Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates. 이번에는 모음으로 시작하지 않는 도시의 이름을 출력하는 문제입니다. 기존 문제 풀..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 8

Weather Observation Station 8 | HackerRank Query CITY names that start AND end with vowels. www.hackerrank.com 이번에도 정규표현식 문제 풀이입니다. 문제) Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates. 첫 번째 글자와 마지막 글자가 모음으로 끝나는 도시 이름을 출력하는 문제입니다. 이제 점점 LIKE 구문으로는 풀기가 어렵다기 보단 귀찮아지는 문제로 점점 바뀌고 있습니다 ..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 7

Weather Observation Station 7 | HackerRank Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. www.hackerrank.com 이번에도 정규표현식으로 문제를 풀어봅니다. 문제) Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. 앞선 6번 문제와 다르게 모음으로 끝나는 도시의 이름을 출력하는 문제인데요. LIKE 구문으로 풀면 [where city like '%a' or ~] 이러한 방식으로 풀면 되겠습니다. 다만, 쿼리가 길어..

[해커랭크] MySQL 정규표현식 - Weather Observation Station 6

Weather Observation Station 6 | HackerRank Query a list of CITY names beginning with vowels (a, e, i, o, u). www.hackerrank.com 해커랭크 SQL 문제 중 모음으로 시작하는 도시의 이름을 찾는 문제입니다. 이 문제는 두 가지 문제로 풀어볼 수 있는데 LIKE 구문과 정규표현식, 두 가지 방법으로 풀 수 있습니다. 문제) Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. 1) LIKE 구문으로 풀이 select distinct cit..