SELECT is how you read data — by far the most-used SQL statement. You choose which columns to return and which table to read from.
Selecting columns
SELECT name, package -- specific columnsFROM students;SELECT * -- all columns (convenient, but be deliberate)FROM students;SELECT name AS student_name -- rename a column in the outputFROM students;
A word on SELECT *
Key takeaways
- 01SELECT columns FROM table reads data — the core SQL statement.
- 02List specific columns rather than SELECT * in real queries.
- 03AS renames a column in the result (an alias).
- 04SQL keywords are conventionally uppercase; statements end with a semicolon.
