The SQL SELECT Statement

Author: Al-mamun Sarkar Date: 2020-04-14 17:31:16

The SQL SELECT Statement. The following SQL Commands are used to run the select query on the database. 

 

Select all Data:

SELECT * FROM tablename;

Example:

SELECT * FROM employees;

 

Select Columns:

SELECT col1, col2, ...
FROM tablename;

 Example:

SELECT name, city 
FROM employees;

 

SELECT DISTINCT:

SELECT DISTINCT column
FROM table_name;

Example:

SELECT DISTINCT country 
FROM employees;