새소식

IT/SQL

[해커랭크] Revising the Select Query 2

  • -
728x90
반응형

문제링크 : https://www.hackerrank.com/challenges/revising-the-select-query-2/problem?isFullScreen=true

 

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 NAME
FROM CITY
WHERE POPULATION >120000 AND COUNTRYCODE = 'USA';

Revising the Select Query 1과 비슷한 문제다.

NAME columns만 출력하는데 CITY table에서 population이 120000이상, countrycode가 USA인 항목을 뽑으면 된다.

SELECT에 찾고자하는 칼럼(필드명)을 적고 FROM에 table, WHERE에 조건을 적어주면 된다.

Oracle의 경우 ;(세미콜론)을 명시해줘야한다.

728x90

'IT > SQL' 카테고리의 다른 글

[해커랭크] Japanese Cities' Names  (0) 2023.03.07
[해커랭크] Japanese Cities' Attributes  (0) 2023.03.07
[해커랭크] Select By ID  (0) 2023.03.07
[해커랭크] Select All  (0) 2023.03.07
[해커랭크] Revising the Select Query 1  (0) 2023.03.06
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.