HackerRank SQL — All Details of American Cities with Population Over 100000
Source: Dev.to
Solution
The task is to retrieve all columns for American cities with a population greater than 100,000.
SELECT *
FROM CITY
WHERE COUNTRYCODE = 'USA'
AND POPULATION > 100000;SELECT *returns every column from theCITYtable.- The
WHEREclause applies two conditions combined withAND: the city must be in the United States (COUNTRYCODE = 'USA') and its population must exceed 100,000.
This query builds on basic SELECT and WHERE concepts, combining them to filter the desired rows.