SQL Select Query - SQL Select Statement Example



Demo mydatabase

  • Below is a selection from the mytable table used in the examples:
sql-select-command-1

Syntax

SELECT column1, column2, ...
FROM table_name;
  • Here, column1, column2, ... are the field names of the table you want to select data from.
  • The table_name represents the name of the table you want to select data from.

The SQL SELECT Statement

  • The SELECT statement is used to select data from a database.

Example

  • Return data from the mytable table:
  SELECT NAME FROM mytable

Output

sql-select-statement-2

Select ALL columns

    If you want to return all columns, without specifying every column name, you can use the SELECT * syntax:

Example

  • Return all the columns from the mytable table:
  SELECT * FROM mytable

Output

sql-select-statement-3

Related Searches to SQL Select Query - SQL Select Statement Example