Hello Coders, Welcome to our Hacker Rank SQL Solutions Series. Today we are going to solve first problem of this SQL Series which is Revising the Select Query I Hacker Rank Solution.
Task
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
The CITY table is described as follows:
CITY
Field | Type |
ID | NUMBER |
NAME | VARCHAR2(17) |
COUNTRYCODE | VARCHAR2(3) |
DISTRICT | VARCHAR2(20) |
POPULATION | NUMBER |
Solution – Revising the Select Query I
MYSQL
SELECT * FROM CITY WHERE COUNTRYCODE = 'USA' AND POPULATION > 100000;
Disclaimer: The above Problem (Revising the Select Query I) is generated by Hacker Rank but the Solution is provided by CodingBroz. This tutorial is only for Educational and Learning Purpose.