SQL SELECT COMMAND


SQL Select Command | SQL Tutorial | Minigranth

SQL SELECT Command : Introduction

  • 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.

This image describes the basic syntax of all the select queries that can be used in various sql select command.
SQL SELECT Command : Syntax

OR


This image describes the basic syntax of all the select queries that can be used in sql.
SQL SELECT Command : Syntax

OR


This image describes the basic syntax of all the select queries that can be used in sql.
SQL SELECT Command : Syntax

OR


This image describes the basic syntax of all the select queries that can be used in sql.
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

    This image describes the select query results.

  • Query-1 : SELECT * from student_details;


    Output: This image describes the select query results.

    Query-2 : SELECT name from student_details;


    Output: This image describes the select query results.

    Query-3 : SELECT name, marks from student_details;


    Output: This image describes the select query results.

    Query-4 : SELECT * from student_details where marks = 50;


    Output: This image describes the select query results.