Select statement is used to fetch data from a table.
Mainly the data is fetched by two ways using select statement.
- Fetching the specific column/columns only, and
- Fetching whole data of table.
Fetching the specified columns
To fetch specific column/columns the columns are mentioned as the following syntax
Syntax:
SELECT column1, column2 FROM table_name;
Example: To fetch Roll_No and and name from the table students
SELECT Roll_No, Name FROM students;
This will fetch the values as shown below:
![](https://res.cloudinary.com/alex-tech/image/upload/v1662459144/Learn2Done/SQL/Select1_xlaten.png)
Fetching the whole data from table
Syntax:
SELECT * FROM table_name;
Example:
SELECT * FROM students;
This will fetch the whole table as below:
![](https://res.cloudinary.com/alex-tech/image/upload/v1662453079/Learn2Done/SQL/Inserting_type2_zc7vg4.png)