The SELECT statement is used to select data from a

database.

Select particular fields

Syntax

SELECT column1, column2, ...
FROM table_name;

Here, column1, column2, ... are the field names of the table you want to select data from.

The table_name represents the name of the table you want to select data from.

Select ALL colums

use ***** in fields

SELECT * FROM Customers;

Select Distinct data

The SELECT DISTINCT statement is used to return only distinct (different) values.

Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.

Get all values

SELECT DISTINCT Country FROM Customers;
// Canada, America, China, ...

count the numbers of distinct values

SELECT COUNT(DISTINCT Country) FROM Customers;
// 21