SQL Select Statement

Reads records from the database.

Syntax

SELECT select_columns FROM table_name [WHERE expression]
select_columns:   * for all columns or comma separated list of column names
table_name:  name of table to select records from
expression:   column | constant | parameter | not (expression) | (expression) |
expression operator expression | in (expression [, expression...])
operator:   or | and | = | != | < | > | <= | >=

Example

select * from persons where name='bob' and age>=30
persons table
name age occupation
bob 30 plumber
bob 24 electrician
mary 35 CEO

results

name age occupation
bob 30 plumber