SQL SELECT
Choose the columns you want to return from a table.
How it works
SELECT is the starting point for most read-only SQL work. It tells the database which columns should appear in the result. Selecting only the fields you need makes results easier to read and often reduces unnecessary work.
Use * while exploring a small demo table, but prefer explicit column names in production reports so the output stays predictable when a table changes.
A production report may need only PO, material and status instead of every technical column in the source table.
The pattern
SELECT column1, column2
FROM table_name;Example
SELECT OrderID, CustomerID, Status
FROM Orders;Run the example
Edit the query and run it against the built-in demo tables. Nothing is sent to a server.
The learning runner supports SELECT, WHERE, LIKE, IN, BETWEEN, GROUP BY, HAVING, JOIN, aggregates, ORDER BY and LIMIT. Advanced lessons explain additional production SQL concepts even when the mini runner does not execute that syntax.
Which query returns only OrderID and Status?
Progress is stored only in this browser. No account required.