Hacker Rank SQL

Revising the Select Query II Solution

Hello Friends in this article i am gone to share Hacker Rank SQL Solutions with you | Revising the Select Query II Solution


Also visit this link:  Revising the Select Query I Solution


 

Revising the Select Query II

Task

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

The CITY table is described as follows:

Field Type
ID NUMBER
NAME VARCHAR2(17)
COUNTRYCODE VARCHAR2(3)
DISTRICT VARCHAR2(20)
POPULATION NUMBER

 

Solution – Revising the Select Query II

MYSQL Code
select name from city
where countrycode = 'USA' and population > 120000

 

Easiest way to solve SQL Revising the Select Query II

Explaination:

The solution is easy and straight forward.

Sql Statement:

select name from city where countrycode = 'USA' and population > 120000
  • The question says to select  name from cities where country code is USA and whose population is more than 120000,
  • Now we give a condition mentioning that we want only those cities whose country code is USA and the population must be greater than or atleast grater then to 120000.
  • Finally we run the query to check the outcomes , here is what we get.

 

Disclaimer: The above Problems are generated by Hacker Rank but the Solutions are Provided by NYANDER.COM. All Hacker Rank SQL Solutions Shared only for Educational and Learning Purpose.

 

Disclaimer: The above Problems are generated by Hacker Rank but the Solutions are Provided by NYANDER.COM. All Hacker Rank SQL Solutions Shared only for Educational and Learning Purpose.