본문 바로가기
서버/MYSQL

[MYSQL] HACKERRANK - Revising the Select Query II

by HDobby 2022. 5. 31.

https://www.hackerrank.com/challenges/revising-the-select-query-2

 

Revising the Select Query I | HackerRank

Query the data for all American cities with populations larger than 100,000.

www.hackerrank.com

Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA.

The CITY table is described as follows:

이전 문제와의 차이점은 Select에서 원하는 컬럼을 추가해야 하는 부분만 달라졌다.

이전 문제 : https://hdobby.tistory.com/3

 

기본 WHERE문과 SELECT문 사용 문제

SELECT에서 Name만 선택

Countrycode 가 USA

POUPLATION 이 12만 초과

 

 

코드

더보기
SELECT NAME
FROM CITY
WHERE POPULATION > 120000 AND COUNTRYCODE = 'USA';

 

728x90

댓글