bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL SELECT Statement

Concept visual

SQL SELECT Statement

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

The SQL SELECT Statement

The SELECT

statement is used to select data from a database.

Example

Return data from the Customers table:

SELECT CustomerName, City FROM Customers;

SELECT Syntax

Select

column1, column2, ...

From

table_name

;

Here, column1, column2, ... are the column names in the table you want to select data from. The table_name represents the name of the table you want to select data from.

Demo Database

Below is a selection from the

Customers table used in the examples:

CustomerID

CustomerName

ContactName

Address

City

PostalCode

Country

Alfreds Futterkiste

Maria Anders

Obere Str. 57

Berlin

12209

Germany

Ana Trujillo Emparedados y helados

Ana Trujillo

Avda. de la Constitución 2222 México D.F. 05021

Mexico

Antonio Moreno Taquería

Antonio Moreno

Mataderos 2312

México D.F. 05023

Previous

SQL Syntax

Next

SQL SELECT DISTINCT Statement