SELECTING DATA

If I want to analyze my data, for example considering I own a grocery shop, I want to find out the total products sold by me, I can make use of a simple SELECT Statement.

The select statement in SQL is used to ask the database for a specific set of information.

SYNTAX

41.png
 
 

Here, column1Name, column2Name are the values of the table you want to fetch from the database.

EXAMPLE

If I want to fetch the entire content of the table, then I can use the following syntax:

42.png

Here we are using a "*" to select all columns.

43.png

Figure 15.1. Select * from Table_Name

  •  If I want to analyze only the product prices, then the following Query can be used:

44.png

Figure 15.2. Analyzing the Product prices

PRACTICE YOURSELF 

45.png
 

Want More SQL Deep Dives