데이터분석

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 7

❓ Question https://www.hackerrank.com/challenges/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 ❗ Answer SELECT DISTINCT(city) FROM station WHERE RIGHT(city,1) IN ('a','e','i','o','u'); 📌 Discussion - RIGHT(column,n)은 column의 data에서 오른쪽 끝부터 n번째까지 추출하는 함수

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 6

❓ Question https://www.hackerrank.com/challenges/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 ❗ Answer SELECT DISTINCT(city) FROM station WHERE LEFT(city,1) IN ('a','e','i','o','u'); 📌 Discussion - LEFT(column,num)으로 왼쪽부터 num번째까지의 데이터를 추출 - a IN b 으로 b안에 a가 있는 레코드만 추출

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 4

❓ Question https://www.hackerrank.com/challenges/weather-observation-station-4 Weather Observation Station 4 | HackerRank Find the number of duplicate CITY names in STATION. www.hackerrank.com ❗ Answer SELECT COUNT(city)-COUNT(DISTINCT city) FROM station; 📌 Discussion - COUNT로 레코드의 개수를 집계

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 3

❓ Question https://www.hackerrank.com/challenges/weather-observation-station-3 Weather Observation Station 3 | HackerRank Query a list of unique CITY names with even ID numbers. www.hackerrank.com ❗ Answer SELECT DISTINCT(city) FROM station WHERE id%2 = 0; 📌 Discussion - DISTINCT로 중복된 레코드 제거

SQL 문제풀이

[해커랭크 SQL] Basic Select - Weather Observation Station 1

❓ Question https://www.hackerrank.com/challenges/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. www.hackerrank.com ❗ Answer SELECT city, state FROM station; 📌 Discussion - SELECT 원하는 컬럼만 추출

SQL 문제풀이

[해커랭크 SQL] Basic Select - Japanese Cities' Names

❓ Question https://www.hackerrank.com/challenges/japanese-cities-name Japanese Cities' Names | HackerRank In this challenge, you will query a list of all the Japanese cities' names. www.hackerrank.com ❗ Answer SELECT name FROM city WHERE countrycode = 'JPN'; 📌 Discussion - SELECT 문에서 name 컬럼만 추출

SQL 문제풀이

[해커랭크 SQL] Basic Select - Japanese Cities' Attributes

❓ Question https://www.hackerrank.com/challenges/japanese-cities-attributes Japanese Cities' Attributes | HackerRank Query the attributes of all the cities in Japan. www.hackerrank.com ❗ Answer SELECT * FROM city WHERE countrycode = 'JPN'; 📌 Discussion - WHERE 절에서 조건문으로 필터링

SQL 문제풀이

[해커랭크 SQL] Basic Select - Select By ID

❓ Question https://www.hackerrank.com/challenges/select-by-id ❗ Answer SELECT * FROM city WHERE id = 1661; 📌 Discussion - number type 데이터는 숫자형식으로 조건문에 걸어줘야한다.

냄비짱
'데이터분석' 태그의 글 목록 (5 Page)