<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>develop_wan.log</title>
        <link>https://velog.io/</link>
        <description>서른. 개발자가 되기로 했다</description>
        <lastBuildDate>Mon, 03 Jan 2022 09:46:44 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <copyright>Copyright (C) 2019. develop_wan.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/develop_wan" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - SQL Project Planning]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-SQL-Project-Planning</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-SQL-Project-Planning</guid>
            <pubDate>Mon, 03 Jan 2022 09:46:44 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/sql-projects/problem?isFullScreen=true">https://www.hackerrank.com/challenges/sql-projects/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/4d9922d2-3ca6-475e-80c3-b72de1be08c5/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
태스크의 종료_날짜가 연속이면 태스크는 동일한 프로젝트의 일부입니다. 사만다는 완료된 프로젝트의 총 개수를 찾는 데 관심이 있습니다.</p>
</blockquote>
<p>프로젝트를 완료하는 데 걸린 일 수를 기준으로 나열된 프로젝트의 시작 날짜와 종료 날짜를 오름차순으로 출력하는 쿼리를 작성합니다. 완료 일수가 동일한 프로젝트가 두 개 이상 있는 경우 프로젝트의 시작 날짜로 정렬합니다.</p>
<pre><code class="language-MSSQL">select
    p1.start_date
,   p2.end_date
from
    (
    select
        start_date
    ,   row_number() over (order by start_date) as rn
    from
        projects
    where
        start_date not in (
                          select
                              end_date
                          from
                              projects)
    ) as p1
    join
        (
        select
            end_date
        ,   row_number() over (order by end_date) as rn
        from
            projects
        where
            end_date not in (
                            select
                                start_date
                            from
                                projects)
        ) as p2 on p1.rn = p2.rn
order by
    datediff(day,p1.start_date,p2.end_date)
,   p1.start_date</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Contest Leaderboard]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Contest-Leaderboard</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Contest-Leaderboard</guid>
            <pubDate>Mon, 03 Jan 2022 09:40:07 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/contest-leaderboard/problem?isFullScreen=true">https://www.hackerrank.com/challenges/contest-leaderboard/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/e5e4eeca-3fbe-4f17-8ffc-0e3c71faf04e/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
해커의 총점은 모든 과제에 대한 최대 점수의 합계입니다. 내림차순 점수로 정렬된 해커의 hacker_id, 이름 및 총 점수를 출력하기 위한 쿼리를 작성합니다. 둘 이상의 해커가 동일한 총점을 획득한 경우 hacker_id 오름차순으로 결과를 정렬합니다. 총점 0점의 모든 해커를 당신의 결과에서 제외하세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    h.hacker_id
,   h.name
,   sum(score)
from
    (
    select
        hacker_id
    ,   challenge_id
    ,   max(score) as score
    from
        submissions
    group by
        hacker_id
    ,   challenge_id
    ) as t
    join hackers as h on t.hacker_id = h.hacker_id
group by
    h.hacker_id
,   h.name
having
    sum(score) &gt; 0
order by
    sum(score) desc
,   h.hacker_id</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Challenges]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Challenges</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Challenges</guid>
            <pubDate>Mon, 03 Jan 2022 09:32:20 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/challenges/problem?isFullScreen=true">https://www.hackerrank.com/challenges/challenges/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/fba982b9-bb61-4fce-9d81-c145e75058cc/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
Julia는 학생들에게 코딩 문제를 만들어보라고 부탁했습니다. 질의를 작성하여 hacker_id, 이름 및 각 학생이 만든 총 도전 횟수를 출력합니다. 내림차순으로 총 도전 횟수별로 결과를 정렬합니다. 둘 이상의 학생이 동일한 수의 문제를 만든 경우 hacker_id를 기준으로 결과를 정렬합니다. 두 명 이상의 학생이 동일한 수의 과제를 만들었고, 그 횟수가 생성된 최대 과제 수보다 적으면, 해당 학생을 결과에서 제외합니다.</p>
</blockquote>
<pre><code class="language-MSSQL">with
    data
as
    (
    select
        h.hacker_id as id
    ,   h.name as name
    ,   count(h.hacker_id) as counter
    from
        hackers as h
        join challenges as c on h.hacker_id = c.hacker_id
    group by
        h.hacker_id
    ,   h.name
    )
select
    id
,   name
,   counter
from
    data
where
    counter = (
              select
                  max(counter)
              from
                  data
              )
    or
    counter in (
               select
                   counter
               from
                   data
               group by
                   counter
               having
                   count(counter) = 1
               )
order by
    counter desc
,   id</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Ollivander's Inventory]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Ollivanders-Inventory</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Ollivanders-Inventory</guid>
            <pubDate>Mon, 03 Jan 2022 09:21:30 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/harry-potter-and-wands/problem?isFullScreen=true">https://www.hackerrank.com/challenges/harry-potter-and-wands/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/2a7cc743-3d68-4de3-8e18-88da4e054cf7/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
해리 포터와 그의 친구들은 론과 함께 올리밴더스에 가서, 마침내 찰리의 망가진 오래된 지팡이를 교체합니다.</p>
</blockquote>
<p>헤르미온느는 강력한 힘과 나이를 가진 각각의 사악한 지팡이를 사는 데 필요한 최소 금 갤리온의 수를 결정하는 것이 최선의 선택이라고 판단한다. 론이 관심 있는 지팡이의 ID, 나이, 동전_필요, 파워를 내림차순으로 정렬하여 인쇄하는 쿼리를 작성합니다. 두 개 이상의 지팡이가 동일한 힘을 가진 경우 결과를 내림차순으로 정렬합니다.</p>
<pre><code class="language-MSSQL">select
    w.id
,   p.age
,   w.coins_needed
,   w.power
from
    wands as w
    join wands_property as p on w.code = p.code
where
    p.is_evil = 0
    and
    w.coins_needed in (
                      select
                          min(w1.coins_needed)
                      from
                          wands as w1
                          join wands_property as p1 on w1.code = p1.code
                      where
                          w.power = w1.power
                          and
                          p.age = p1.age
                      )
order by
    w.power desc
,   p.age desc</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Top Competitors]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Top-Competitors</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Top-Competitors</guid>
            <pubDate>Mon, 03 Jan 2022 09:15:26 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/full-score/problem?isFullScreen=true">https://www.hackerrank.com/challenges/full-score/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/3b9b5710-adcc-4e75-85be-c6cd6c389253/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/610e86bb-018f-471b-8619-841c9a382426/2.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/bfa0a91c-190b-43f8-91ae-24067aa952e5/3.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/be49dec2-ea5c-4592-89dd-341177fa7179/4.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
줄리아는 코딩 대회를 막 끝냈고, 리더보드를 조립하는데 당신의 도움이 필요해요! 쿼리를 작성하여 하나 이상의 챌린지에 대해 전체 점수를 획득한 각 hacker_id 및 해커의 이름을 인쇄합니다. 해커가 만점을 획득한 총 문제 수에 따라 출력을 내림차순으로 정렬합니다. 둘 이상의 해커가 동일한 수의 챌린지에서 전체 점수를 받은 경우 오름차순 hacker_id를 기준으로 정렬합니다.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    h.hacker_id
,   h.name
from
    hackers as h
    join submissions as s on s.hacker_id = h.hacker_id
    join challenges as c on c.challenge_id = s.challenge_id
    join difficulty as d on d.difficulty_level = c.difficulty_level
where
    s.score = d.score
    and
    c.difficulty_level = d.difficulty_level
group by
    h.hacker_id
,   h.name
having
    count(h.hacker_id) &gt; 1
order by
    count(h.hacker_id) desc
,   h.hacker_id</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - The Report]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-The-Report</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-The-Report</guid>
            <pubDate>Mon, 03 Jan 2022 09:08:59 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/the-report/problem?isFullScreen=true">https://www.hackerrank.com/challenges/the-report/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/06980f57-c4ae-45e5-91fe-4ff47da2e1ad/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/553d40e5-45a9-490e-898f-8fef474053a0/2.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/f6bfb201-63dc-4f0d-85df-c64364d83f44/3.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
케티는 이브에게 세 개의 열을 포함하는 보고서를 생성하는 작업을 준다. 이름, 등급 및 마크. 케티는 8점 이하의 점수를 받은 학생들의 이름을 원하지 않는다. 보고서는 등급별로 내림차순으로 작성되어야 합니다. 즉, 상위 등급이 먼저 입력됩니다. 동일한 등급(8-10)의 학생이 두 명 이상 있는 경우 해당 학생의 이름을 알파벳 순으로 정렬합니다. 마지막으로 등급이 8보다 낮으면 &#39;NULL&#39;을 이름으로 사용하고 등급별로 내림차순으로 나열한다. 같은 등급(1-7)의 학생이 두 명 이상 있는 경우 해당 학생의 점수를 오름차순으로 정렬합니다.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    case
        when g.grade &lt; 8 then null
        else s.name
    end
,   g.grade
,   s.marks
from
    students as s
    join grades as g on s.marks between g.min_mark and g.max_mark
order by
    g.grade desc
,   s.name
,   s.marks</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Average Population of Each Continent]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Average-Population-of-Each-Continent</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Average-Population-of-Each-Continent</guid>
            <pubDate>Mon, 03 Jan 2022 09:03:46 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true">https://www.hackerrank.com/challenges/average-population-of-each-continent/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/33eecfd5-3c55-414e-b772-168e8977daa9/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/8aa6c9a6-56e7-46ed-b5ff-8d283bb6303e/2.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
도시 및 국가 표에 따라 모든 대륙의 이름을 쿼리합니다.(대륙)과 각각의 평균 도시 인구(CITY).모집단)은 가장 가까운 정수로 내림됩니다.</p>
</blockquote>
<p>참고: CITY.CountryCode와 COUNTRY.Code가 일치하는 키 열입니다.</p>
<pre><code class="language-MSSQL">select
    co.continent
,   floor(avg(ci.population))
from
    city as ci
    join country as co on ci.countrycode = co.code
group by
    co.continent</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - African Cities]]></title>
            <link>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-African-Cities</link>
            <guid>https://velog.io/@develop_wan/MSSQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-African-Cities</guid>
            <pubDate>Mon, 03 Jan 2022 08:59:14 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/african-cities/problem?isFullScreen=true">https://www.hackerrank.com/challenges/african-cities/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/0cdcc797-2c6a-4370-916d-a448e9901891/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/661ad050-6361-4f0c-8468-b5b88da42e20/2.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
도시 및 국가 표에 따라 대륙이 &#39;africa&#39;인 모든 도시의 이름을 조회합니다.</p>
</blockquote>
<p>참고: CITY.CountryCode 와 COUNTRY.Code가 일치하는 키 열입니다.</p>
<pre><code class="language-MSSQL">select
    ci.name
from
    city as ci
    join country as co on ci.countrycode = co.code
where
    co.continent = &#39;africa&#39;</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Population Census]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Population-Census</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHackerRank-Population-Census</guid>
            <pubDate>Mon, 03 Jan 2022 08:55:28 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true">https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/7bade681-aeb4-4cc6-a64e-ac4ec999e759/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/da3fb148-6ac1-4c3d-a8cb-734039767e7f/2.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
도시 및 국가 표에 따라 유럽 대륙이 &#39;아시아&#39;인 모든 도시의 인구 합계를 쿼리합니다.</p>
</blockquote>
<p>참고: city.countrycode 와 country.code가 일치하는 키 열입니다.</p>
<pre><code class="language-MSSQL">select
    sum(ci.population)
from
    city as ci
    join country as co on ci.countrycode = co.code
where
    co.continent = &#39;asia&#39;</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 20]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-20</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-20</guid>
            <pubDate>Thu, 30 Dec 2021 06:29:09 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-20/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-20/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/16e3048f-d570-4355-838a-b7019abccd01/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
중위수는 데이터 집합의 위쪽 절반과 아래쪽 절반을 구분하는 숫자로 정의됩니다. STATION에서 북위도(LAT_N)의 중위수를 조회하고 소수점 4자리까지 반올림하십시오.</p>
</blockquote>
<pre><code class="language-MSSQL">select top(1)
    format(round(percentile_cont(0.5) within group(order by lat_n)over(),4),&#39;#.0000&#39;)
from
    station</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 19]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-19</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-19</guid>
            <pubDate>Thu, 30 Dec 2021 06:25:30 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-19/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-19/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/e65ebb81-0640-4aa4-888e-18aa9d0291a0/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
P1(a,c)과 P2(b,d)를 2D 평면의 두 점으로 간주하고, 여기서 (a,b)는 북위도(LAT_N)의 각 최소값과 최대값이고, (c,d)는 스테이션에서 서부 경도(LONG_W)의 각 최소값과 최대값이다.</p>
</blockquote>
<p>점 P1과 P2 사이의 유클리드 거리를 쿼리하고 소수점 4자리를 표시하도록 답의 형식을 지정합니다.</p>
<pre><code class="language-MSSQL">select
    format(sqrt(power(max(lat_n) - min(lat_n),2) + power(max(long_w) - min(long_w),2)),&#39;#.0000&#39;)
from
    station</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 18]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-18</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-18</guid>
            <pubDate>Thu, 30 Dec 2021 06:20:21 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-18/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-18/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/decd29ac-8060-488e-a909-f59e490390ea/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
P1(a,b)과 P2(c,d)를 2D 평면의 두 점이라고 가정하자.</p>
</blockquote>
<p>a는 북위도의 최소값과 같습니다(STATION의 LAT_N).
b는 서부 경도의 최소값과 같습니다(STATION의 LONG_W).
c는 북위도의 최대값과 같습니다(STATION의 LAT_N).
d는 서부 경도의 최대값과 같습니다(STATION의 LONG_W).
점 사이의 맨하탄 거리를 쿼리하고 소수점 4자리 척도로 반올림합니다</p>
<pre><code class="language-MSSQL">select
-- Manhattan Distance(P1(a,b),P2(c,d)) = (c-a)+(d-b)
    format(max(lat_n) - min(lat_n) + max(long_w) - min(long_w),&#39;#.0000&#39;)
from
    station</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 17]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-17</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-17</guid>
            <pubDate>Thu, 30 Dec 2021 06:00:19 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-17/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-17/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/8c65098f-f61f-4bce-89f6-51ec91ffe9f9/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
스테이션에서 가장 작은 북위도(LAT_N)가 38.7780보다 큰 서부 경도(LONG_W)를 쿼리합니다. 당신의 답을 소수점 4자리까지 반올림하세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    format(long_w,&#39;#.0000&#39;)
from
    station
where
    lat_n = (select
                min(lat_n)
             from
                station
             where
                lat_n &gt; 38.7780)</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 16]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-16</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-16</guid>
            <pubDate>Thu, 30 Dec 2021 05:25:56 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-16/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-16/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/b60e3a58-2527-46eb-87df-0952bf85f133/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
38.7780보다 큰 가장 작은 북위도(LAT_N)를 스테이션에서 쿼리합니다. 당신의 답을 소수점 4자리까지 반올림하세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    format(min(lat_n),&#39;#.0000&#39;)
from
    station
where
    lat_n &gt; 38.7780</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 15]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-15</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-15</guid>
            <pubDate>Thu, 30 Dec 2021 05:21:56 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-15/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-15/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/87d0764c-7dd2-45f9-b5d7-4283ba776e3f/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
STATION에서 137.2345보다 작은 가장 큰 북위도(LAT_N)에 대한 서부 경도(LONG_W)를 쿼리합니다. 당신의 답을 소수점 4자리까지 반올림하세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    format(long_w,&#39;#.0000&#39;)
from
    station
where
    lat_n = (select
                max(lat_n)
             from
                station
             where
                lat_n &lt; 137.2345)</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 14]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-14</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-14</guid>
            <pubDate>Thu, 30 Dec 2021 05:14:38 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-14/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-14/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/f523aaf4-bd1a-4d5c-8637-1c5166574fdb/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
STATION에서 137.2345보다 작은 북반구 최대값(LAT_N)을 쿼리합니다. 당신의 답을 소수점 4자리까지 잘라내세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    format(max(lat_n),&#39;#.0000&#39;)
from
    station
where
    lat_n &lt; 137.2345</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 13]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-13</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-13</guid>
            <pubDate>Thu, 30 Dec 2021 05:11:17 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-13/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-13/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/41c79a09-881a-4e35-b566-5e319ec34677/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
STATION에서 값이 38.7880보다 크고 137.2345보다 작은 LAT_N 합계를 쿼리합니다. 당신의 답을 소수점 4자리까지 잘라내세요.</p>
</blockquote>
<pre><code class="language-MSSQL">select
    format(sum(lat_n),&#39;#.0000&#39;)
from
    station
where
    lat_n between 38.7880 and 137.2345</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Weather Observation Station 2]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-2</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Weather-Observation-Station-2</guid>
            <pubDate>Thu, 30 Dec 2021 05:05:50 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/weather-observation-station-2/problem?isFullScreen=true">https://www.hackerrank.com/challenges/weather-observation-station-2/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/ed1ba507-4437-48f1-87ce-89b09ea590f3/1.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
STATION 테이블에서 다음 두 값을 쿼리합니다.</p>
</blockquote>
<p>LAT_N의 모든 값의 합계는 소수점 2자리 척도로 반올림됩니다.
LONG_W의 모든 값의 합계는 소수점 2자리 척도로 반올림됩니다.</p>
<pre><code class="language-MSSQL">select
    format(round(sum(lat_n),2),&#39;#.00&#39;)
,   format(round(sum(long_w),2),&#39;#.00&#39;)
from
    station</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - Top Earners]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Top-Earners</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-Top-Earners</guid>
            <pubDate>Thu, 30 Dec 2021 04:43:45 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/earnings-of-employees/problem?isFullScreen=true">https://www.hackerrank.com/challenges/earnings-of-employees/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/afd90b53-260e-4e4b-8c54-963d1865bcef/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/cdf7bc85-f54b-4b4f-ab2e-b185bb458786/2.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
직원의 총 수입은 월별 근로로 정의되며, 최대 총 수입은 직원 테이블에 있는 모든 직원의 최대 총 수입으로 정의됩니다. 전체 직원의 최대 총 수입과 최대 총 수입이 있는 직원 수를 찾기 위해 쿼리를 작성하십시오. 그런 다음 이 값을 공백으로 구분된 정수로 인쇄합니다.</p>
</blockquote>
<pre><code class="language-MSSQL">select top(1)
    months * salary
,   count(months * salary)
from
    employee
group by
    months * salary
order by
    months * salary desc</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MSSQL] 해커랭크(HackerRank) - The Blunder]]></title>
            <link>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-The-Blunder</link>
            <guid>https://velog.io/@develop_wan/MS-SQL-%ED%95%B4%EC%BB%A4%EB%9E%AD%ED%81%ACHacker-Rank-The-Blunder</guid>
            <pubDate>Thu, 30 Dec 2021 04:35:24 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.hackerrank.com/challenges/the-blunder/problem?isFullScreen=true">https://www.hackerrank.com/challenges/the-blunder/problem?isFullScreen=true</a></p>
<hr>
<p><strong>문제</strong>
<img src="https://images.velog.io/images/develop_wan/post/06a52f6e-3442-4bf0-ab24-a33c1ca24c90/1.PNG" alt=""><img src="https://images.velog.io/images/develop_wan/post/ac444980-9140-40b0-bc6e-9bb1ba8d2fcd/2.PNG" alt=""></p>
<hr>
<blockquote>
<p><strong>해석</strong>
사만다는 직원 테이블에 있는 모든 직원의 평균 월급을 계산하는 일을 맡았지만 계산을 마친 후에야 키보드의 0 키가 고장 났다는 것을 알았다. 그녀는 자신의 오산(0을 빼고 계산)과 실제 평균 급여 간의 차이를 찾는 데 도움을 받고자 합니다.</p>
</blockquote>
<p>오류의 양(즉, 실제 평균 급여 - 잘못 계산된 월평균 급여)을 계산하는 질의를 작성하여 다음 정수로 반올림합니다.</p>
<pre><code class="language-MSSQL">select
    cast(ceiling(avg(cast(salary as float)) 
    - avg(cast(replace(salary,0,&#39;&#39;) as float))) as int)
from
    employees</code></pre>
<p>※ EMPLOYEE TABLE의 Salary COLUMN의 TYPE은 &#39;INTEGET(정수)&#39;이므로
실제 평균 급여, 잘못 계산된 월 평균 급여를 모두 &#39;FLOAT(실수)&#39; TYPE으로 변경 후 계산한 값을 정수로 반올림 진행</p>
<ul>
<li>실제 평균 급여
avg(cast(salary as float)</li>
<li>잘못 계산된 월평균 급여
avg(cast(replace(salary,0,&#39;&#39;) as float))</li>
</ul>
]]></description>
        </item>
    </channel>
</rss>