April 3, 2024, 9:59 p.m. | Christian Paez

DEV Community dev.to

Problem Statement:

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


Link:HackerRank - Revising the SELECT Query 2


Solution:



SELECT NAME FROM CITY WHERE POPULATION > 120000 AND COUNTRYCODE = 'USA';


Explanation:




  • SELECT NAME: This part of the query specifies that you want to retrieve the NAME field.


  • FROM CITY: Indicates that you are selecting data from the CITY table.


  • WHERE POPULATION > 120000: This condition …

america american cities city hackerrank link mysql name preparation problem query select solution sql statement usa writeups

Information Security Engineers

@ D. E. Shaw Research | New York City

Technology Security Analyst

@ Halton Region | Oakville, Ontario, Canada

Senior Cyber Security Analyst

@ Valley Water | San Jose, CA

Senior - Penetration Tester

@ Deloitte | Madrid, España

Associate Cyber Incident Responder

@ Highmark Health | PA, Working at Home - Pennsylvania

Senior Insider Threat Analyst

@ IT Concepts Inc. | Woodlawn, Maryland, United States