Hackerrank – SQL – Select All

Problem Description

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
VARCHA…


This content originally appeared on DEV Community and was authored by Mr Punk da Silva

Problem Description

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

Solution Approach

Use a simple SELECT statement with the asterisk (*) wildcard to retrieve all columns from the CITY table.

Step-by-Step Explanation

  1. Start with the SELECT statement and use the asterisk (*) to select all columns:
   SELECT *
  1. Specify the table to query from:
   FROM CITY;
  1. The final query:
   SELECT
   *
   FROM CITY;

Expected Output

The query will return all rows from the CITY table, displaying all columns (ID, NAME, COUNTRYCODE, DISTRICT, POPULATION) for each city in the database.


This content originally appeared on DEV Community and was authored by Mr Punk da Silva


Print Share Comment Cite Upload Translate Updates
APA

Mr Punk da Silva | Sciencx (2025-07-21T23:10:56+00:00) Hackerrank – SQL – Select All. Retrieved from https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/

MLA
" » Hackerrank – SQL – Select All." Mr Punk da Silva | Sciencx - Monday July 21, 2025, https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/
HARVARD
Mr Punk da Silva | Sciencx Monday July 21, 2025 » Hackerrank – SQL – Select All., viewed ,<https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/>
VANCOUVER
Mr Punk da Silva | Sciencx - » Hackerrank – SQL – Select All. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/
CHICAGO
" » Hackerrank – SQL – Select All." Mr Punk da Silva | Sciencx - Accessed . https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/
IEEE
" » Hackerrank – SQL – Select All." Mr Punk da Silva | Sciencx [Online]. Available: https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/. [Accessed: ]
rf:citation
» Hackerrank – SQL – Select All | Mr Punk da Silva | Sciencx | https://www.scien.cx/2025/07/21/hackerrank-sql-select-all/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.