inblog logo
|
silver
    SQL문제풀기

    [SQL문제풀기] Basic Select 8~

    silver's avatar
    silver
    Apr 02, 2025
    [SQL문제풀기] Basic Select 8~
    Contents
    문제8 - Weather Observation Station 1문제9 - Weather Observation Station 3문제10 - Weather Observation Station 4

    문제8 - Weather Observation Station 1

    Weather Observation Station 1 | HackerRank
    Write a query to print the CITY and STATE for each attribute in the STATION table.
    Weather Observation Station 1 | HackerRank
    https://www.hackerrank.com/challenges/weather-observation-station-1/problem?isFullScreen=true
    Weather Observation Station 1 | HackerRank

    MySQL, Oracle, DB2, MS SQL Server

    select city, state from station;

    문제9 - Weather Observation Station 3

    Weather Observation Station 3 | HackerRank
    Query a list of unique CITY names with even ID numbers.
    Weather Observation Station 3 | HackerRank
    https://www.hackerrank.com/challenges/weather-observation-station-3/problem?isFullScreen=true
    Weather Observation Station 3 | HackerRank

    MySQL, MS SQL Server

    select distinct city from station where id % 2 = 0;

    Oracle, DB2

    select distinct city from station where mod(id,2)=0;

    문제10 - Weather Observation Station 4

    Weather Observation Station 4 | HackerRank
    Find the number of duplicate CITY names in STATION.
    Weather Observation Station 4 | HackerRank
    https://www.hackerrank.com/challenges/weather-observation-station-4/problem?isFullScreen=true
    Weather Observation Station 4 | HackerRank

    MySQL,Oracle, DB2, MS SQL Server

    select count(city) - count(distinct city) from station;
    Share article

    silver

    RSS·Powered by Inblog