SELECT Statement in SQL

The select statement in SQL is used for fetching data from the database.
it returns the result table called result-set.

Syntax:
select column1,column2......columnN from tableName;

where column1,column2....columnN all are the column name from which you want to select data.
and tableName will be the name of a table.
One can also select all the column from the table without giving the column name in the select statement.


Syntax:
select * from tableName;

it will return all column of the table

Example:
We have student table with ID, Name, Course, MobileNo and Email columns.


The following statement will select the Name, Course, and Email from student table.


select Name, Course, Email from student;
Output:

The following statement will select the all columns from student table


select * from student;
Output: