HackerRank SQL Solutions

RostoryT·2022년 7월 15일
0

sql

목록 보기
5/5

해커랭크 sql 정답 모음


1. Basic Select

I. Revising the Select Query 1
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.

The CITY table is described as follows:

select *
from city 
where countrycode = 'USA' 
and population > 100000;

II. Revising the Select Query 2
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 countrycode = 'USA'
and population > 120000;

IV. Select By ID
Query all columns for a city in CITY with the ID 1661.

The CITY table is described as follows:

select *
from city
where id = '1661'

V. Japanese Cities’ Attributes
Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN.

The CITY table is described as follows:

select *
from city
where countrycode = 'JPN'
profile
Do My Best

0개의 댓글