Skip to content
Main menu
  • Main page
  • Discover
  • Unexpected connections
  • Topics
  • Random article
  • Search
Your library
  • Saved articles
  • Recent discoveries
  • Rabbit-hole trails
Topic areas
  • Computer Science
  • Mathematics
  • Physics
  • Engineering
  • Biology
  • Economics
  • Curiosities
WikiholeDeeper into Wikipedia
EnglishEN
  • Saved
  • History

  • Article text and media come live from Wikipedia via the official MediaWiki API and are available under the Creative Commons Attribution-ShareAlike 4.0 License; additional terms may apply. Each article links to its source and revision.
  • WikiHole is an independent project and is not affiliated with the Wikimedia Foundation.
  • How ranking works
  • All topics
  • Reading history
  • Random article
  • MediaWiki API

Select (SQL)

  • Article
  • Rabbit hole
  • Read
  • View history
Tools
Actions
  • Read
  • View history
General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
12 min
Topic
Computer Science
Quality
C-class
Views
502 in 14 days
Last edited
30 Apr 2026
Print/export
  • Printable version
In other projects
  • Wikidata item
From Wikipedia, the free encyclopedia
Rabbit hole:
  1. Select (SQL)

The SQL SELECT statement returns a result set of rows, from one or more tables.12

A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most applications, SELECT is the most commonly used data manipulation language (DML) command. As SQL is a declarative programming language, SELECT queries specify a result set, but do not specify how to calculate it. The database translates the query into a "query plan" which may vary between executions, database versions and database software. This functionality is called the "query optimizer" as it is responsible for finding the best possible execution plan for the query, within applicable constraints.

The SELECT statement has many optional clauses:

  • SELECT list is the list of columns or SQL expressions to be returned by the query. This is approximately the relational algebra projection operation.
  • AS optionally provides an alias for each column or expression in the list. This is the relational algebra operation.
SELECT
rename
  • FROM specifies from which table to get the data.a
  • WHERE specifies which rows to retrieve. This is approximately the relational algebra selection operation.
  • GROUP BY groups rows sharing a property so that an aggregate function can be applied to each group.
  • HAVING selects among the groups defined by the GROUP BY clause.
  • ORDER BY specifies how to order the returned rows.
  • Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{notelist}} template (see the help page).

    Loading the rest of the article…

    Recent changes

    Rabbit hole

    Where Select (SQL) leads. Every connection below has a source: a link in this article, a shared Wikipedia category, or CirrusSearch text similarity. Articles already on your trail are left out.

    The rest of this article could not be loaded.

    Wikipedia is rate limiting us right now. Try again in a minute.
    Try again

    Related articles are unavailable right now.

    Wikipedia is rate limiting us right now. Try again in a minute.
    Last edited
    30 Apr 2026

    Wikipedia did not return the list of recent edits.

    View full revision history

    General
    • Recent changes
    • Related articles
    • Random discovery
    This article
    Reading time
    12 min
    Topic
    Computer Science
    Quality
    C-class
    Views
    502 in 14 days
    Last edited
    30 Apr 2026
    Print/export
    • Printable version
    In other projects
    • Wikidata item
    Last edited
    30 Apr 2026