{"id":41,"date":"2016-03-21T13:18:17","date_gmt":"2016-03-21T13:18:17","guid":{"rendered":"https:\/\/sqltutorial.org\/?page_id=41"},"modified":"2026-04-01T00:50:53","modified_gmt":"2026-04-01T07:50:53","slug":"sql-select","status":"publish","type":"page","link":"https:\/\/www.sqltutorial.org\/sql-select\/","title":{"rendered":"SQL SELECT"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: In this tutorial, you will learn how to use SQL <code>SELECT<\/code> statement to query data from a single table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-sql-select-statement'>Introduction to SQL SELECT statement <a href=\"#introduction-to-sql-select-statement\" class=\"anchor\" id=\"introduction-to-sql-select-statement\" title=\"Anchor for Introduction to SQL SELECT statement\">#<\/a><\/h2>\n\n\n\n<p>The <code>SELECT<\/code> statement allows you to retrieve data from one or more tables.<\/p>\n\n\n\n<p>Here&#8217;s the basic syntax of the <code>SELECT<\/code> statement that retrieves data from a single table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  select_list\n<span class=\"hljs-keyword\">FROM<\/span>\n  table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify a comma-separated list of columns from the table you want to retrieve data in the <code>SELECT<\/code> clause.<\/li>\n\n\n\n<li>Then, provide the table name in the <code>FROM<\/code> clause.<\/li>\n<\/ul>\n\n\n\n<p>When evaluating the <code>SELECT<\/code> statement, the database system evaluates the <code>FROM<\/code> clause first and then the <code>SELECT<\/code> clause.<\/p>\n\n\n\n<p>The semicolon (<code>;<\/code>) is not part of a query. The database server uses the semicolon to separate two SQL statements.<\/p>\n\n\n\n<p>For example, if you execute two <code>SELECT<\/code> statements, you need to separate them using a semicolon (<code>;<\/code>). Check the <a href=\"https:\/\/www.sqltutorial.org\/sql-syntax\/\">SQL syntax<\/a>&nbsp;for more information.<\/p>\n\n\n\n<p>If you want to retrieve data from all the columns of the table, you can list all the columns in the <code>SELECT<\/code> clause like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  column1,\n  column2,\n  column3\n<span class=\"hljs-keyword\">FROM<\/span>\n  table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Alternatively, you can use the star (*) operator as the shorthand for all columns:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Since SQL is case-insensitive, you can write SQL keywords such as <code>SELECT<\/code> and <code>FROM<\/code> in uppercase, lowercase, camelcase, etc. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">select<\/span> * <span class=\"hljs-keyword\">from<\/span> table_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>By convention, we&#8217;ll use write SQL keywords in uppercase and identifiers such as table names in lowercase. This practice makes SQL statements easier to read.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-select-statement-examples'>SQL SELECT statement examples <a href=\"#sql-select-statement-examples\" class=\"anchor\" id=\"sql-select-statement-examples\" title=\"Anchor for SQL SELECT statement examples\">#<\/a><\/h2>\n\n\n\n<p>We&#8217;ll use the <code>employees<\/code> table in the <a href=\"https:\/\/www.sqltutorial.org\/sql-sample-database\/\">sample database<\/a> for demonstration purposes:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"169\" height=\"273\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png\" alt=\"employees_table\" class=\"wp-image-237\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='selecting-data-from-all-columns-example'>Selecting data from all columns example <a href=\"#selecting-data-from-all-columns-example\" class=\"anchor\" id=\"selecting-data-from-all-columns-example\" title=\"Anchor for Selecting data from all columns example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>SELECT<\/code> statement to retrieve data from all the columns of the <code>employees<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> employees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUICogRlJPTSBlbXBsb3llZXM7\" target=\"_blank\" rel=\"noreferrer noopener\">Try It<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> employee_id | first_name  |  last_name  |               email               | phone_number | hire_date  | job_id |  salary  | manager_id | department_id\n-------------+-------------+-------------+-----------------------------------+--------------+------------+--------+----------+------------+---------------\n         100 | Steven      | King        | steven.king@sqltutorial.org       | 515.123.4567 | 1987-06-17 |      4 | 24000.00 |       NULL |             9\n         101 | Neena       | Kochhar     | neena.kochhar@sqltutorial.org     | 515.123.4568 | 1989-09-21 |      5 | 17000.00 |        100 |             9\n         102 | Lex         | De Haan     | lex.de haan@sqltutorial.org       | 515.123.4569 | 1993-01-13 |      5 | 17000.00 |        100 |             9\n         103 | Alexander   | Hunold      | alexander.hunold@sqltutorial.org  | 590.423.4567 | 1990-01-03 |      9 |  9000.00 |        102 |             6\n         104 | Bruce       | Ernst       | bruce.ernst@sqltutorial.org       | 590.423.4568 | 1991-05-21 |      9 |  6000.00 |        103 |             6\n...\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The result of the <code>SELECT<\/code> statement is called a <strong>result set<\/strong>.<\/p>\n\n\n\n<p>The <code>SELECT *<\/code> is read as the select star. The select star is helpful for ad-hoc queries only. For the application development, you should avoid using the select star for the following reasons:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The select * returns data from all columns of a table. The application often needs data from one or some columns, not all.<\/li>\n\n\n\n<li>If you use the select *, the database system needs more time to read data from the disk and transfer it to the application. This often results in poor performance if the table contains many columns with a lot of data.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='selecting-data-from-specific-columns'>Selecting data from specific columns <a href=\"#selecting-data-from-specific-columns\" class=\"anchor\" id=\"selecting-data-from-specific-columns\" title=\"Anchor for Selecting data from specific columns\">#<\/a><\/h3>\n\n\n\n<p>To retrieve data from specific columns of a table, you can specify the column list in the <code>SELECT<\/code> clause.<\/p>\n\n\n\n<p>For example, the following statement retrieves data from the <code>employee_id<\/code>, <code>first_name<\/code>, <code>last_name<\/code>, and <code>hire_date<\/code> columns in the <code>employees<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n  employee_id,\n  first_name,\n  last_name,\n  hire_date\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGVtcGxveWVlX2lkLCBmaXJzdF9uYW1lLCBsYXN0X25hbWUsIGhpcmVfZGF0ZSBGUk9NIGVtcGxveWVlczs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try It<\/a><\/p>\n\n\n\n<p>The result set includes only four specified columns:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> employee_id | first_name  |  last_name  | hire_date\n-------------+-------------+-------------+------------\n         100 | Steven      | King        | 1987-06-17\n         101 | Neena       | Kochhar     | 1989-09-21\n         102 | Lex         | De Haan     | 1993-01-13\n         103 | Alexander   | Hunold      | 1990-01-03\n         104 | Bruce       | Ernst       | 1991-05-21\n         105 | David       | Austin      | 1997-06-25\n...<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='performing-calculations'>Performing calculations <a href=\"#performing-calculations\" class=\"anchor\" id=\"performing-calculations\" title=\"Anchor for Performing calculations\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>SELECT<\/code> statement to retrieve the <code>first_name<\/code>, <code>last_name<\/code>, <code>salary<\/code>, and new salary.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    first_name, \n    last_name, \n    salary, \n    salary * <span class=\"hljs-number\">1.05<\/span>\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5LCBzYWxhcnkgKiAxLjA1IEZST00gZW1wbG95ZWVzOw%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>The expression <code>salary * 1.05<\/code> adds <code>5%<\/code> to the salary of every employee.<\/p>\n\n\n\n<p>When you have an expression that involves table columns, you create a calculated column.<\/p>\n\n\n\n<p>The database system may assign a temporary name to the calculated column. For example, MySQL assigns the expression as the column name, while PostgreSQL uses <code>?column?<\/code> as the column name of the calculated column.<\/p>\n\n\n\n<p>Here&#8217;s the output of PostgreSQL:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"plaintext\" data-shcb-language-slug=\"plaintext\"><span><code class=\"hljs language-plaintext\"> first_name  |  last_name  |  salary  |  ?column?\n-------------+-------------+----------+------------\n Steven      | King        | 24000.00 | 25200.0000\n Neena       | Kochhar     | 17000.00 | 17850.0000\n Lex         | De Haan     | 17000.00 | 17850.0000\n Alexander   | Hunold      |  9000.00 |  9450.0000\n Bruce       | Ernst       |  6000.00 |  6300.0000\n...<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">plaintext<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">plaintext<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='column-aliases'>Column aliases <a href=\"#column-aliases\" class=\"anchor\" id=\"column-aliases\" title=\"Anchor for Column aliases\">#<\/a><\/h2>\n\n\n\n<p>A column alias is a temporary name you assign to a column during the execution of a query.&nbsp;<\/p>\n\n\n\n<p>Here&#8217;s the syntax for using a column alias:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">expression AS column_alias<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax, the <code>AS<\/code> keyword is optional. Therefore, you can omit it to make the query more concise:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">expression column_alias<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example, the following <code>SELECT<\/code> statement uses the <code>new_salary<\/code> as the column alias for the&nbsp; calculated column that uses the expression ( <code>salary * 1.05<\/code>):<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    first_name, \n    last_name, \n    salary, \n    salary * <span class=\"hljs-number\">1.05<\/span> <span class=\"hljs-keyword\">AS<\/span> new_salary\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5LCBzYWxhcnkgKiAxLjA1IEFTIG5ld19zYWxhcnkgRlJPTSBlbXBsb3llZXM7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\"> first_name  |  last_name  |  salary  | new_salary\n-------------+-------------+----------+------------\n Steven      | King        | 24000.00 | 25200.0000\n Neena       | Kochhar     | 17000.00 | 17850.0000\n Lex         | De Haan     | 17000.00 | 17850.0000\n Alexander   | Hunold      |  9000.00 |  9450.0000\n Bruce       | Ernst       |  6000.00 |  6300.0000\n...<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the&nbsp;<code>SELECT<\/code>&nbsp;statement to retrieve data from a table.<\/li>\n\n\n\n<li>Use the <code>SELECT star<\/code> to retrieve data from all columns of a table.<\/li>\n\n\n\n<li>A column alias is a temporary name of a column in a query.<\/li>\n\n\n\n<li>&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='databases'>Databases <a href=\"#databases\" class=\"anchor\" id=\"databases\" title=\"Anchor for Databases\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.pgtutorial.com\/postgresql-tutorial\/postgresql-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">PostgreSQL SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.oracletutorial.com\/oracle-basics\/oracle-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">Oracle SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQL Server SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mysqltutorial.org\/mysql-basics\/mysql-select-from\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">SQLite SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.db2tutorial.com\/db2-basics\/db2-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">Db2 SELECT statement<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-select\/\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB SELECT statement<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='quiz'>Quiz <a href=\"#quiz\" class=\"anchor\" id=\"quiz\" title=\"Anchor for Quiz\">#<\/a><\/h2>\n\n\n\n<p><iframe loading=\"lazy\" class=\"iframe\" src=\"\/quiz\/?quiz=select\" name=\"quiz\" width=\"600\" height=\"700\"><\/iframe><\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"41\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-select\/\"\n\t\t\t\tdata-post-title=\"SQL SELECT\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"41\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-select\/\"\n\t\t\t\tdata-post-title=\"SQL SELECT\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you step by step how to use the SQL SELECT statement to query data from a single table.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-41","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL SELECT Statement<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqltutorial.org\/sql-select\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL SELECT Statement\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltutorial.org\/sql-select\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-01T07:50:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png\" \/>\n\t<meta property=\"og:image:width\" content=\"169\" \/>\n\t<meta property=\"og:image:height\" content=\"273\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/\",\"url\":\"https:\/\/www.sqltutorial.org\/sql-select\/\",\"name\":\"SQL SELECT Statement\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltutorial.org\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png\",\"datePublished\":\"2016-03-21T13:18:17+00:00\",\"dateModified\":\"2026-04-01T07:50:53+00:00\",\"description\":\"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltutorial.org\/sql-select\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage\",\"url\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png\",\"contentUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png\",\"width\":169,\"height\":273,\"caption\":\"SQL Correlated Subquery - employees table\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-select\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltutorial.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL SELECT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltutorial.org\/#website\",\"url\":\"https:\/\/www.sqltutorial.org\/\",\"name\":\"SQL Tutorial\",\"description\":\"An Interactive SQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltutorial.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL SELECT Statement","description":"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqltutorial.org\/sql-select\/","og_locale":"en_US","og_type":"article","og_title":"SQL SELECT Statement","og_description":"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.","og_url":"https:\/\/www.sqltutorial.org\/sql-select\/","og_site_name":"SQL Tutorial","article_modified_time":"2026-04-01T07:50:53+00:00","og_image":[{"width":169,"height":273,"url":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqltutorial.org\/sql-select\/","url":"https:\/\/www.sqltutorial.org\/sql-select\/","name":"SQL SELECT Statement","isPartOf":{"@id":"https:\/\/www.sqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage"},"image":{"@id":"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png","datePublished":"2016-03-21T13:18:17+00:00","dateModified":"2026-04-01T07:50:53+00:00","description":"This tutorial shows you how to use the SQL SELECT statement to retrieve data from a single table.","breadcrumb":{"@id":"https:\/\/www.sqltutorial.org\/sql-select\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltutorial.org\/sql-select\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltutorial.org\/sql-select\/#primaryimage","url":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png","contentUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2016\/03\/employees.png","width":169,"height":273,"caption":"SQL Correlated Subquery - employees table"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltutorial.org\/sql-select\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"SQL SELECT"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltutorial.org\/#website","url":"https:\/\/www.sqltutorial.org\/","name":"SQL Tutorial","description":"An Interactive SQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":1,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/41\/revisions"}],"predecessor-version":[{"id":3641,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/41\/revisions\/3641"}],"wp:attachment":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/media?parent=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}