SQL SELECT statement is the most commonly used statement. It is used to retrieve the selected data from a table following the conditions we use.
The syntax of select statement is
Here ‘*’ is an expression and is used when all columns are to be retrieved.
If any particular column is to be retrieved then the column name must be in the place of ‘*’.
The conditions are optional when using the SELECT statement.
Let us take a Student table in a database.
If you want to select the data from the above table then it is written as follows:
SELECT * FROM Student;
The output of the above statement is given as
If you want to select any particular column like Student_Name here then the query is written as
Then the data will be displayed as
If you want to retrieve more than one column then the column names should be separated by a comma (,)