HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

>

The SQL SELECT Statement


TheSELECT statement is used to select data from a database.

Example:

Return employee name and city from the Employee table:

SELECT Employee_name,City FROM `employee`;


employee name_city

Syntax


SELECT column1, column2, ...
FROM table_name;

Here, column1, column2, ... are the field names of the table.

The table_name represents the name of the table.

Select ALL columns


If you want to return all columns, without specifying every column name, you can use the SELECT * Syntax:

Example:

Return all the columns from the Customers table:

SELECT * FROM `employee`;


employee table