Problem Statement:
Query all columns for a city in the CITY table with the ID 1661.
Link: HackerRank - Select by ID
Solution:
SELECT * FROM CITY WHERE ID = 1661;
Explanation:
This query will return all the columns for the row in the CITY table where the ID is 1661. It's useful when you need to retrieve all details about a specific city identified by its unique ID.
By running this query, you can see all the attributes (such as city name, country code, population, etc.) for the city that has the ID of 1661.
The above is the detailed content of HackerRank SQL Preparation: Select by ID(MySQL). For more information, please follow other related articles on the PHP Chinese website!