SELECT Reference

From SQLZOO
Revision as of 11:07, 11 August 2012 by Andr3w (Talk | contribs)

Jump to: navigation, search

The SELECT command is used to show data from a database.

The output from a SELECT statement is always a grid - with a number of rows and a number of columns. The simplest SELECT commands involve a single table:

SELECT name, population
  FROM bbc
 WHERE region='North America'
<tbody></tbody>
namepopulation
Canada32000000
Mexico106400000
United States of America295000000
  • The SELECT line determines which columns to show - in this case name and population, both of which are columns of the bbc ta le.
  • The WHERE clause determines which rows to show
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense