🗃️SELECT Statement
Also known as SELECT, SQL SELECT, SELECT Query, SELECT FROM
The SQL command that reads data out of a table.
Think of it like
It is like asking a shop helper for things off the shelf. You say what you want and they bring it.
Example
Emma wants the names of all her customers. She runs SELECT name FROM customers, and gets back one row per customer.
Why it matters
It is the command people run most in SQL. Every report, search and list in an app starts with a SELECT.
Definition
Example code
sql
SELECT name, city
FROM customers
ORDER BY name
LIMIT 10;Common mistake
Key takeaways
- 1Columns, then table. SELECT what, FROM where.
- 2Add parts as needed. WHERE, ORDER BY, LIMIT.
- 3Reads, never changes. A SELECT leaves the data as it was.