Writing Basic SQL Select Statements With Actual Demonstration

Writing Basic SQL Select Statements With Actual Demonstration

This tutorial for beginners about Writing Basic SQL SELECT Statements is useful if you are trying to develop a system with a database. The SQL Select statement is used to extract data from the database.

You may also need to restrict all the columns you want to be displayed.

This lesson will show you all the SQL statements you need to perform these actions.

Capabilities of SQL SELECT Statements

A SELECT statement retrieves information from the database. With SELECT Statement, you can also do the following:

  • Projection – You can choose the columns in the table that you want to returned by your query. It’s up to you to choose few or many columns of the table as you require.
  • Selection – You can use various criteria to restrict the rows that you see.
  • Joining – You can bring all the data together that is stored from different tables by creating a link between them.

Simplest Form of SELECT Statements, It includes the following:

Basic SQL Select Statements



  2. * / Asterisk

    Means all the columns from all tables in the from statement are to be returned.


    This is used to eliminate duplication of records.


    Selects the name of column

  5. ALIAS

    Using an alias, you can set a unique or proper heading of a column


    It uses to specify the target table containing the columns.

For example we have here a sample table named tblsampleemployee:

1Kobe Bryant789541250000SHIPPING
2Jordan Michael789541270000IT
3James BOnd123245645000SALES
4Anne Curtis787889835000SHIPPING
5John Wick1233455765000EXECUTIVE
6Hatch Glets6654878257000IT
7Xyre Anderson7877892348000SALES

Selecting All Columns

The SELECT statement tells what is to be returned. ‘*’means all the columns from all tables in the from statement are to be returned.


The above command would display the whole table.

Now, we want to select two columns EMP_ID, EMPNAME, and CONTACT:

This would give the following result:

1Kobe Bryant7895412
2Jordan Michael7895412
3James BOnd1232456
4Anne Curtis7878898
5John Wick12334557
6Hatch Glets66548782
7Xyre Anderson78778923

Select Statement to eliminate duplication Records.


So, in the query above we used “DISTINCT” keyword to eliminate duplicate records.

Video Tutorial of Writing basic SQL SELECT Statements

Watch the video tutorial here for complete practice with actual demonstration.

Download here the database used in the video demonstration

For Inquiries

If you have any questions about How to Write a Basic SQL SELECT Statement, please leave a comment below.

Comments 5 Responses

  1. Weddy Faustino February 28, 2021
    • itsourcecode February 28, 2021
  2. Dionisio III Datiles March 2, 2021
  3. Dionisio III Datiles March 2, 2021
  4. Dionisio III Datiles March 2, 2021

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.