DEV Community

Cover image for HackerRank SQL Preparation: Japanese Cities' Names(MySQL)
Christian Paez
Christian Paez

Posted on

3

HackerRank SQL Preparation: Japanese Cities' Names(MySQL)

Problem Statement:
Query the names of all Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.

Link: HackerRank - Japanese Cities Name

Solution:

SELECT NAME FROM CITY WHERE COUNTRYCODE = 'JPN';
Enter fullscreen mode Exit fullscreen mode

Explanation:

  • SELECT NAME: This part of the query specifies that you want to retrieve the NAME column from the CITY table.
  • FROM CITY: Indicates that you are selecting data from the CITY table.
  • WHERE COUNTRYCODE = 'JPN': This condition filters the rows to include only those cities where the COUNTRYCODE is 'JPN' (Japan).

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more