
Problem
Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN.
Input Format
The CITY table is described as follows:
| Field | Type |
|---|---|
| ID | NUMBER |
| NAME | VARCHAR2(17) |
| COUNTRYCODE | VARCHAR2(3) |
| DISTRICT | VARCHAR2(20) |
| POPULATION | NUMBER |
Analysis
- query the names ==> SELECT NAME
- in the CITY table ==> FROM CITY
- COUNTRYCODE for Japan is JPN ==> COUNTRYCODE = ‘JPN’
- Japanese cities ==> WHERE COUNTRYCODE = ‘JPN’
Solution
|
|
Link
Japanese Cities’ Names
(中文版) SQL 笔记: Hackerrank Japanese Cities’ Names




近期评论