SQL Select Statement
Posted on
< Previous Next >
The SELECT statement in SQL is used to retrieve data from a database table. We use it to specify which columns we want to retrieve and which rows we want to retrieve them from.
Select Syntax
SELECT column1, column2, ...
FROM table_name;
Here's an example:
Let's say we have a table named "student" with columns "id", "name", "email", "phone", and "address".
We can use the SELECT statement to retrieve all the data from the table like this.
OUTPUT

In this above example,
This statement retrieves all columns and rows from the "student" table. The "*" symbol means "all columns". We can also select specific columns from the table.
For example, to retrieve only the "name" and "email" columns from the "student" table,
SELECT name, email FROM student;
OUTPUT

< Previous Next >