SQL SELECT Statement

  • The SELECT statement retrieves data from a database.
  • The data is returned in a table-like structure called a result-set.
  • SELECT is the most frequently used action on a database.
The definitive guide
for data professionals

Order today!
 See 2 min video

The SQL SELECT syntax

The general syntax is:
SELECT column-names
  FROM table-name

To select all columns use *
  FROM table-name


Problem: List all customers
  FROM Customer

Results:  91 records

Id FirstName LastName City Country Phone
1 Maria Anders Berlin Germany 030-0074321
2 Ana Trujillo México D.F. Mexico (5) 555-4729
3 Antonio Moreno México D.F. Mexico (5) 555-3932
4 Thomas Hardy London UK (171) 555-7788
5 Christina Berglund Luleå Sweden 0921-12 34 65

Problem: List the first name, last name, and city of all customers
SELECT FirstName, LastName, City
  FROM Customer

Results:  91 records

FirstName LastName City
Maria Anders Berlin
Ana Trujillo México D.F.
Antonio Moreno México D.F.
Thomas Hardy London
Christina Berglund Luleå