> For the complete documentation index, see [llms.txt](https://pavithrasundaram091097s-organiza.gitbook.io/my-space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pavithrasundaram091097s-organiza.gitbook.io/my-space/skills/hackerrank/revising-the-select-query-ii.md).

# Revising the Select Query II

Query the **NAME** field for all American cities in the **CITY** table with populations larger than `120000`. The *CountryCode* for America is `USA`.

{% embed url="<https://www.hackerrank.com/challenges/revising-the-select-query-2/problem?isFullScreen=true>" %}

The **CITY** table is described as follows:\
![CITY.jpg](https://s3.amazonaws.com/hr-challenge-images/8137/1449729804-f21d187d0f-CITY.jpg)

Solution:

SELECT NAME FROM CITY WHERE population>120000 AND CountryCode = "USA";

Explanation:

* SELECT NAME: This part of the query specifies that we only want to retrieve the names of the cities.
* FROM CITY :  This tells us that we're looking in the CITY table for the data.
* WHERE population>120000:  This condition filters the cities based on their population, only selecting those with populations greater than 120,000.
* AND CountryCode = "USA" : This is another condition added to the WHERE clause. It specifies that we only want cities with the country code "USA".
