We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.
To query just the names of all Japanese cities from the CITY table, where the COUNTRYCODE for Japan is 'JPN', you can use the following SQL query:
SELECTNAMEFROMCITYWHERECountryCode='JPN';
In this query:
- SELECT NAME specifies that you only want to retrieve the NAME field from the CITY table.
- FROM CITY indicates the table from which you are querying.
- The WHERE CountryCode = 'JPN' clause filters the results to include only cities that have the country code 'JPN', which corresponds to Japan.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Japanese Cities' Names
You are viewing a single comment's thread. Return to all comments →
Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.
To query just the names of all Japanese cities from the
CITY
table, where theCOUNTRYCODE
for Japan is 'JPN', you can use the following SQL query:In this query: -
SELECT NAME
specifies that you only want to retrieve theNAME
field from theCITY
table. -FROM CITY
indicates the table from which you are querying. - TheWHERE CountryCode = 'JPN'
clause filters the results to include only cities that have the country code 'JPN', which corresponds to Japan.