The SQL SELECT statement allows you to retrieve records from one or more tables in your SQL database. For SQL SELECT statements can be used with WHERE clauses and also using relationship by joining tables.

The result is stored in a result table, called the result-set.

The syntax for the SQL SELECT statement is:

Below SQL Statement is used to retrieve data from database based on column names.
[sql] SELECT column_name1, column_name2 FROM table_name;

Below SQL Statement is used to Select entire data from a database table.

[sql] SELECT * FROM table_name;

If you want to get data for only one record WHERE clause can be added to above SQL statement

[sql] SELECT * FROM table_name WHERE Id=1;

After adding WHERE clause, data can be retrieved from specific columns.

[sql] SELECT column_name1, column_name2 FROM table_name WHERE Id=1;

Using SELECT statement records can be retrieved from multiple tables using relationships between tables and by joining tables.

Vivek Vengala

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.