The SQL SELECT command is the only Data Query Language Command over which whole data extraction and retrieval is dependent.
The SQL SELECT command is used for “fetching and extracting data from databases or tables”.
While fetching data through SELECT command, certain conditions can be attached in order to generate specific results from the query. Let’s look at the examples now:
SQL SELECT Command : Syntax
There are a number of possible combinations while using SELECT query out of which some are listed below.
SQL SELECT Command : Syntax
OR
SQL SELECT Command : Syntax
OR
SQL SELECT Command : Syntax
OR
SQL SELECT Command : Syntax
SQL SELECT Command : Example
We will continue with the database i.e db_school and table i.e student_details we had created earlier and try to give a possible example for each of the above mentioned syntax available. Considering the table and details we had:
Table : student_details
Query-1 : SELECT * from student_details;
Output:
Query-2 : SELECT name from student_details;
Output:
Query-3 : SELECT name, marks from student_details;
Output:
Query-4 : SELECT * from student_details where marks = 50;