Problem
Query all attributes of every Japanese city 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 all attributes ==> SELECT *
- in the CITY table ==> FROM CITY
- COUNTRYCODE for Japan is JPN ==> COUNTRYCODE = ‘JPN’
- Japanese city ==> WHERE COUNTRYCODE = ‘JPN’
Solution
|
|
Link
Japanese Cities’ Attributes
(中文版) SQL 笔记: Hackerrank Japanese Cities’ Attributes
近期评论