SQL Tutorials - SELECT Statement (Learn in 5 minutes)

 The Select Statement


  • The SQL 'SELECT' statement is used to select a particular set of columns from a particular table or database.
  • The output of 'SELECT' statement also depends on various conditions, which we will discuss in detail.

The examples of how to use SQL 'Select statement are as follows:


Q). Select all data from a table named 'Avengers'

Here, our input would be as follows:
          
SELECT  *
FROM Avengers
        
Its quite confusing right ?, Why did we use a '*' here ?, It is because a '*' is used to select all data from the entire table or database. FROM is used to get data from the particular table


Q) Select all the names from the table 'Avengers'

Here, our input would be as follows:

SELECT names
FROM Avengers

Here, names is a column in the table Avengers. In this way, we can select a particular column from a table.


Q) Select all the names, ages from the table Avengers

Here, our input would be as follows:

SELECT names, ages
FROM Avengers

In this way, we can select multiple columns in any table or database.

Points to Remember:

  • The SELECT Statement is used to one or more columns from any particular table or database.
  • The '*' is used to get all records from the table.
  • FROM is used to get data from a particular table or database.
Syntax:

SELECT column_name(s)
FROM table_name

Comments

Popular posts from this blog

How to clear the Alteryx Designer Core Certification Exam in Two Weeks

Current Affairs - 15 April 2021 - Current Affairs for General Knowledge and also to prepare for competitive exams

Current Affairs - 12 June 2021 - Daily Current Affairs for general knowledge and to prepare for competitive exams