SQL SELECT

SELECT is used to select a particular column or show all the data which is stored in the database. The data returned is stored in a result table, called the result-set.

 

SELECT Syntax:

SELECT column1, column2 FROM table_name;

Here, Column1, Column2.... are the particular attributes you want to select from the table. If you want to select all the fields available in the table, use the following syntax:

 

Syntax: 

SELECT * FROM table_name;

To retrieve all the records.

 

Example Database:

This is  customer  table. In this table, all the values or data stored in item table will be displayed.

id name age
1 Kailash 25
2 Amit 27
3 Siddarth 32

This is the way to select a record from the database. 

SELECT * FROM customer;

 

If you want to show only customer name from tha table.

SELECT name From customer

Result:

name
Kailash
Amit
Siddarth