HackerRank: Select By ID
Question and Answer:

Key Points:
What the Query Does
- Fetches all columns for the city with ID = 1661
Key Conditions Used
WHERE ID = 1661ensures we only retrieve the specific city requested
Why It Works
SELECT *returns all available fields (ID, NAME, COUNTRYCODE, DISTRICT, POPULATION)ID uniquely identifies a city, so the result will be one row (or none if not found)
Output
- One row containing the full details of city with ID 1661