본문 바로가기
Algorithm & SQL/SQL

Revising the Select Query I

by YoonJong 2022. 6. 7.
728x90

해커랭크 가장 SQL 가장 첫 문제이다.

 

city 테이블에서 인구수가 100,000 초과이며, countrycode 가 usa 인 곳만 출력하는 문제이다

 

정답 : select * from city where countrycode = 'usa' and population > 100000;

풀이 : 모든 city 테이블을 가져오기 와야 하므로  * 를 사용했고, population 은 100,000 초과 , countrycode 는 usa로 작성한다. usa 를 작성할때 ' ' 를 빼먹지 않도록 한다.

728x90

'Algorithm & SQL > SQL' 카테고리의 다른 글

Weather Observation Station 3  (0) 2022.06.07
Japanese Cities' Names  (0) 2022.06.07
Japanese Cities' Attributes  (0) 2022.06.07
Select By ID  (0) 2022.06.07
Revising the Select Query II  (0) 2022.06.07

댓글