# Select By ID

Query all columns for a city in **CITY** with the *ID* `1661`.

{% embed url="<https://www.hackerrank.com/challenges/select-by-id/problem?isFullScreen=true>" %}

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

Solution:

SELECT \* FROM CITY WHERE ID = 1661;

Explanation:

* SELECT \* : This part of the query indicates that we want to retrieve all columns from the CITY table.
* FROM CITY : This specifies the table from which we want to retrieve the data, which is the CITY table.
* WHERE ID = 1661 : This is a condition added to the query using the WHERE clause. It filters the rows in the CITY table so that only rows where the value in the ID column is equal to 1661 are included in the result.
