HackerRank: Revising the Select Query II
Problem:
https://www.hackerrank.com/challenges/revising-the-select-query-2
Question:

Code:
SELECT
NAME
FROM CITY
WHERE COUNTRYCODE='USA'
AND POPULATION>120000
Key Points:
What the Query Does
Retrieves the names of U.S. cities
Only cities with population > 120,000 are included
Key Conditions Used
COUNTRYCODE = 'USA'→ filters for American citiesPOPULATION > 120000→ ensures only larger cities are selected
Why It Works
Only the NAME column is selected as required
The WHERE clause applies both conditions correctly — using AND
Output
- List of qualifying city names (may return multiple rows)