Learn SQL by solving problem #3
Here is one of the easy problems of HackerRank, with its solution, examination, and brief query.
Problem 3
Query all columns (attributes) for every row in the CITY table.
Input Format
The CITY table is described as follows:
Field | Type |
ID | NUMBER |
NAME | VARCHAR2(17) |
COUNTRYCODE | VARCHAR2(3) |
DISTRICT | VARCHAR2(20) |
POPULATION | NUMBER |
Examination
“Query all columns” is going to be: SELECT *
“in the CITY table” means: FROM CITY
Code
The final code is going to be:
SELECT * FROM CITY;