Go to: Articles List

SQL Basics Part 1 : Select Statement

The most basic SQL statement that you can use is the Select statement. This statement will allow you to get a set of records from a database.

Syntax:

SELECT (column names or *) FROM TableName

The * is a wildcard that allows you to select all columns from a table instead of naming the ones that you want.

Example:

SELECT * FROM fruits

If this were a real table, you would get back all of the colums in the fruits table, along with all of the data in those columns.