Select All Customers
Easy
SQLSELECT
Problem
Schema: Customer(id INT, name VARCHAR, country VARCHAR).
Return every column of every row in Customer, ordered by id ascending.
Example 1
Input: Customer rows: (1,"Ada","UK"), (3,"Bo","US"), (2,"Cy","JP")
Output: (1,"Ada","UK"), (2,"Cy","JP"), (3,"Bo","US")
Constraints
idis unique.nameandcountryare NOT NULL.
Approach — Core Patterns
This is a Core Patterns problem. The idea: pick the data structure best matched to the constraints and solve it in one clean pass. Work through the reference code below line by line, then re-derive it yourself in the editor — that's how the pattern sticks.
Complexity: see the walkthrough below.
Solution code
SQL
SELECT id, name, country
FROM Customer
ORDER BY id;
Practice it
Reading a solution isn't the same as being able to write it under pressure. Open this problem in the in-browser editor, hide the solution, and solve it from scratch — your code runs against real test cases instantly.
Solve Select All Customers interactively → ← All solutions