{"id":1221,"date":"2018-01-16T20:42:05","date_gmt":"2018-01-17T03:42:05","guid":{"rendered":"https:\/\/sqltutorial.org\/?page_id=1221"},"modified":"2025-01-19T02:13:21","modified_gmt":"2025-01-19T09:13:21","slug":"sql-logical-operators","status":"publish","type":"page","link":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/","title":{"rendered":"SQL Logical Operators"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about the SQL logical operators and how to use them to test for the truth of a condition.<\/p>\n\n\n\n<p>A logical operator allows you to test for the truth of a condition. Similar to a <a href=\"https:\/\/www.sqltutorial.org\/sql-comparison-operators\/\">comparison operator<\/a>, a logical operator returns a value of true, false, or unknown.<\/p>\n\n\n\n<p>The following table illustrates the SQL logical operators:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><strong>Operator<\/strong><\/th><th><strong>Meaning<\/strong><\/th><\/tr><\/thead><tbody><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-all\/\">ALL<\/a><\/td><td>Return true if all comparisons&nbsp;are true<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-and\/\">AND<\/a><\/td><td>Return true if both expressions are true<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-any\/\">ANY<\/a><\/td><td>Return true if any one of the comparisons is true.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-between\/\">BETWEEN<\/a><\/td><td>Return true if the operand is within a range<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-exists\/\">EXISTS<\/a><\/td><td>Return true if a subquery contains any rows<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-in\/\">IN<\/a><\/td><td>Return true if the operand is equal to one of the value in a list<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-like\/\">LIKE<\/a><\/td><td>Return true if the operand matches a pattern<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-not\/\">NOT<\/a><\/td><td>Reverse the result of any other Boolean operator.<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-or\/\">OR<\/a><\/td><td>Return true if either expression is true<\/td><\/tr><tr><td><a href=\"https:\/\/www.sqltutorial.org\/sql-any\/\">SOME<\/a><\/td><td>Return true if some of the expressions are true<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='and'>AND <a href=\"#and\" class=\"anchor\" id=\"and\" title=\"Anchor for AND\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-and\/\">AND<\/a><\/code> operator allows you to construct multiple conditions in the <code><a href=\"https:\/\/www.sqltutorial.org\/sql-where\/\">WHERE<\/a><\/code> clause of an SQL statement such as <code><a href=\"https:\/\/www.sqltutorial.org\/sql-select\/\">SELECT<\/a><\/code>, <code><a href=\"https:\/\/www.sqltutorial.org\/sql-update\/\">UPDATE<\/a><\/code>, and <code><a href=\"https:\/\/www.sqltutorial.org\/sql-delete\/\">DELETE<\/a><\/code>:<\/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\">expression1 AND expression2<\/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>The <code>AND<\/code> operator returns true if both expressions evaluate to true.<\/p>\n\n\n\n<p>Try it<\/p>\n\n\n\n<p>The following example finds all employees whose salaries are greater than 5,000 and less than 7,000:<\/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  first_name,\n  last_name,\n  salary\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  salary &gt; <span class=\"hljs-number\">5000<\/span>\n  <span class=\"hljs-keyword\">AND<\/span> salary &lt; <span class=\"hljs-number\">7000<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  salary;<\/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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIHNhbGFyeSA%2BIDUwMDAgQU5EIHNhbGFyeSA8IDcwMDAgT1JERVIgQlkgc2FsYXJ5Ow%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"209\" height=\"137\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png\" alt=\"SQL Logical Operators - AND example\" class=\"wp-image-1226\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='or'>OR <a href=\"#or\" class=\"anchor\" id=\"or\" title=\"Anchor for OR\">#<\/a><\/h2>\n\n\n\n<p>Similar to the <code>AND<\/code> operator, the <code><a href=\"https:\/\/www.sqltutorial.org\/sql-or\/\">OR<\/a><\/code> operator combines multiple conditions in an SQL statement&#8217;s <code><a href=\"https:\/\/www.sqltutorial.org\/sql-where\/\">WHERE<\/a><\/code> clause:<\/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\">expression1 OR expression2<\/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>However, the <code><a href=\"https:\/\/www.sqltutorial.org\/sql-or\/\">OR<\/a><\/code> operator returns true if a least one expression evaluates to true.<\/p>\n\n\n\n<p>For example, the following statement finds employees whose salary is either 7,000 or 8,000:<\/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>\n  first_name,\n  last_name,\n  salary\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  salary = <span class=\"hljs-number\">7000<\/span>\n  <span class=\"hljs-keyword\">OR<\/span> salary = <span class=\"hljs-number\">8000<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  salary;<\/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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIHNhbGFyeSA9IDcwMDAgT1Igc2FsYXJ5ID0gODAwMCBPUkRFUiBCWSBzYWxhcnk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"208\" height=\"56\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-OR-example.png\" alt=\"SQL Logical Operators - OR example\" class=\"wp-image-1227\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='is-null'>IS NULL <a href=\"#is-null\" class=\"anchor\" id=\"is-null\" title=\"Anchor for IS NULL\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-is-null\/\">IS NULL<\/a><\/code> operator compares a value with a null value and returns true if the compared value is null; otherwise, it returns false.<\/p>\n\n\n\n<p>For example, the following statement finds all employees who do not have a phone number:<\/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> \n    first_name, last_name, phone_number\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    phone_number <span class=\"hljs-keyword\">IS<\/span> <span class=\"hljs-literal\">NULL<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> first_name , last_name;\n<\/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=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgcGhvbmVfbnVtYmVyIEZST00gZW1wbG95ZWVzIFdIRVJFIHBob25lX251bWJlciBJUyBOVUxMIE9SREVSIEJZIGZpcnN0X25hbWUsIGxhc3RfbmFtZTs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"136\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-IS-NULL-example.png\" alt=\"SQL Logical Operators - IS NULL example\" class=\"wp-image-1228\" title=\"SQL Logical Operators - IS NULL example\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='between'>BETWEEN <a href=\"#between\" class=\"anchor\" id=\"between\" title=\"Anchor for BETWEEN\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-between\/\">BETWEEN<\/a><\/code> operator&nbsp;searches for values that are within a set of values, given the minimum value and maximum value. Note that the minimum and maximum values are included as part of the conditional set.<\/p>\n\n\n\n<p>For example, the following statement finds all employees whose salaries are between 9,000 and 12,000.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" 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<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  salary <span class=\"hljs-keyword\">BETWEEN<\/span> <span class=\"hljs-number\">9000<\/span> <span class=\"hljs-keyword\">AND<\/span> <span class=\"hljs-number\">12000<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  salary;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><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=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIHNhbGFyeSBCRVRXRUVOIDkwMDAgQU5EIDEyMDAwIE9SREVSIEJZIHNhbGFyeTs%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"215\" height=\"136\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-BETWEEN-example.png\" alt=\"SQL Logical Operators - BETWEEN example\" class=\"wp-image-1229\" title=\"SQL Logical Operators - BETWEEN example\"\/><\/figure>\n\n\n\n<p>Notice that the value 9,000 and 12,000 are included in the output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='in'>IN <a href=\"#in\" class=\"anchor\" id=\"in\" title=\"Anchor for IN\">#<\/a><\/h2>\n\n\n\n<p>The <code>IN<\/code> operator&nbsp;compares a value to a list of specified values. The <code>IN<\/code> operator returns true if the compared value matches at least one value in the list; otherwise, it returns false.<\/p>\n\n\n\n<p>The following statement finds all employees who work in the department id 8 or 9.<\/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  first_name,\n  last_name,\n  department_id\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  department_id <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-number\">8<\/span>, <span class=\"hljs-number\">9<\/span>)\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  department_id;<\/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=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgZGVwYXJ0bWVudF9pZCBGUk9NIGVtcGxveWVlcyBXSEVSRSBkZXBhcnRtZW50X2lkIElOICg4LCA5KSBPUkRFUiBCWSBkZXBhcnRtZW50X2lkOw%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"198\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-IN-example.png\" alt=\"SQL Logical Operators - IN example\" class=\"wp-image-1230\" title=\"SQL Logical Operators - IN example\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='like'>LIKE <a href=\"#like\" class=\"anchor\" id=\"like\" title=\"Anchor for LIKE\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-like\/\">LIKE<\/a><\/code> operator&nbsp;compares a value to similar values using a wildcard operator. SQL provides two wildcards used in conjunction with the <code>LIKE<\/code> operator:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The percent sign ( <code>%<\/code>) represents zero, one, or multiple characters.<\/li>\n\n\n\n<li>The underscore sign ( <code>_<\/code>) represents a single character.<\/li>\n<\/ul>\n\n\n\n<p>The following statement finds all employees whose first name starts with the string <code>jo<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" 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, first_name, last_name\n<span class=\"hljs-keyword\">FROM<\/span>\n    employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n    first_name <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'jo%'<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> first_name;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><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=U0VMRUNUIGVtcGxveWVlX2lkLCBmaXJzdF9uYW1lLCBsYXN0X25hbWUgRlJPTSBlbXBsb3llZXMgV0hFUkUgZmlyc3RfbmFtZSBMSUtFICdqbyUnIE9SREVSIEJZIGZpcnN0X25hbWU7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"243\" height=\"101\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-LIKE-example.png\" alt=\"SQL Logical Operators - LIKE example\" class=\"wp-image-1231\" title=\"SQL Logical Operators - LIKE example\"\/><\/figure>\n\n\n\n<p>The following example finds all employees with the first names whose the second character is&nbsp;&nbsp;<code>h<\/code>:<\/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  employee_id,\n  first_name,\n  last_name\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  first_name <span class=\"hljs-keyword\">LIKE<\/span> <span class=\"hljs-string\">'_h%'<\/span>\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  first_name;<\/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=U0VMRUNUIGVtcGxveWVlX2lkLCBmaXJzdF9uYW1lLCBsYXN0X25hbWUgRlJPTSBlbXBsb3llZXMgV0hFUkUgZmlyc3RfbmFtZSBMSUtFICdfaCUnIE9SREVSIEJZIGZpcnN0X25hbWU7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"229\" height=\"96\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-LIKE-example-2.png\" alt=\"SQL Logical Operators - LIKE example 2\" class=\"wp-image-1232\" title=\"SQL Logical Operators - LIKE example\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='all'>ALL <a href=\"#all\" class=\"anchor\" id=\"all\" title=\"Anchor for ALL\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-all\/\">ALL<\/a><\/code> operator compares a value to all values in another value set. The <code>ALL<\/code> operator must be preceded by a <a href=\"https:\/\/www.sqltutorial.org\/sql-comparison-operators\/\">comparison operator<\/a>&nbsp;and followed by a <a href=\"https:\/\/www.sqltutorial.org\/sql-subquery\/\">subquery<\/a>.<\/p>\n\n\n\n<p>The following illustrates the syntax of the <code>ALL<\/code> operator:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">comparison_operator ALL (subquery)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><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>Note that you will learn about the <a href=\"https:\/\/www.sqltutorial.org\/sql-subquery\/\">subquery<\/a> in the <a href=\"https:\/\/www.sqltutorial.org\/sql-subquery\/\">subquery tutorial<\/a>.<\/p>\n\n\n\n<p>The following example finds all employees whose salaries are greater than all salaries of employees in the department 8:<\/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\"><span class=\"hljs-keyword\">SELECT<\/span>\n  first_name,\n  last_name,\n  salary\n<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  salary &gt;= <span class=\"hljs-keyword\">ALL<\/span> (\n    <span class=\"hljs-keyword\">SELECT<\/span>\n      salary\n    <span class=\"hljs-keyword\">FROM<\/span>\n      employees\n    <span class=\"hljs-keyword\">WHERE<\/span>\n      department_id = <span class=\"hljs-number\">8<\/span>\n  )\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  salary <span class=\"hljs-keyword\">DESC<\/span>;<\/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><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIHNhbGFyeSA%2BPSBBTEwgKCBTRUxFQ1Qgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIGRlcGFydG1lbnRfaWQgPSA4ICkgT1JERVIgQlkgc2FsYXJ5IERFU0M7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"213\" height=\"96\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-ALL-example.png\" alt=\"SQL Logical Operators - ALL example\" class=\"wp-image-1233\" title=\"SQL Logical Operators - ALL example\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='any'>ANY <a href=\"#any\" class=\"anchor\" id=\"any\" title=\"Anchor for ANY\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-any\/\">ANY<\/a><\/code> operator compares a value to any value in a set according to the condition as shown below:<\/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\">comparison_operator ANY(subquery)<\/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>Similar to the ALL operator, the <code>ANY<\/code> operator must be preceded by a <a href=\"https:\/\/www.sqltutorial.org\/sql-comparison-operators\/\">comparison operator<\/a> and followed by a <a href=\"https:\/\/www.sqltutorial.org\/sql-subquery\/\">subquery<\/a>.<\/p>\n\n\n\n<p>For example, the following statement finds all employees whose salaries are greater than the average salary of every department:<\/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<span class=\"hljs-keyword\">FROM<\/span>\n  employees\n<span class=\"hljs-keyword\">WHERE<\/span>\n  salary &gt; <span class=\"hljs-keyword\">ANY<\/span> (\n    <span class=\"hljs-keyword\">SELECT<\/span>\n      <span class=\"hljs-keyword\">AVG<\/span>(salary)\n    <span class=\"hljs-keyword\">FROM<\/span>\n      employees\n    <span class=\"hljs-keyword\">GROUP<\/span> <span class=\"hljs-keyword\">BY<\/span>\n      department_id\n  )\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n  first_name,\n  last_name;<\/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<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"220\" height=\"219\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-SOME-example.png\" alt=\"SQL Logical Operators - SOME example\" class=\"wp-image-1234\" title=\"SQL Logical Operators - SOME example\" srcset=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-SOME-example.png 220w, https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-SOME-example-150x150.png 150w\" sizes=\"auto, (max-width: 220px) 100vw, 220px\" \/><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.sqltutorial.org\/playground\/?q=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSwgc2FsYXJ5IEZST00gZW1wbG95ZWVzIFdIRVJFIHNhbGFyeSA%2BIEFOWSAoIFNFTEVDVCBBVkcoc2FsYXJ5KSBGUk9NIGVtcGxveWVlcyBHUk9VUCBCWSBkZXBhcnRtZW50X2lkICkgT1JERVIgQlkgZmlyc3RfbmFtZSwgbGFzdF9uYW1lOw%3D%3D\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Note that <code>SOME<\/code> is an alias for <code>ANY<\/code>, therefore, you can use them interchangeably.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='exists'>EXISTS <a href=\"#exists\" class=\"anchor\" id=\"exists\" title=\"Anchor for EXISTS\">#<\/a><\/h2>\n\n\n\n<p>The <code><a href=\"https:\/\/www.sqltutorial.org\/sql-exists\/\">EXISTS<\/a><\/code> operator tests if a <a href=\"https:\/\/www.sqltutorial.org\/sql-subquery\/\">subquery<\/a> contains any rows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">EXISTS (subquery)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><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>If the subquery returns one or more rows, the result of the <code>EXISTS<\/code> is true; otherwise, the result is false.<\/p>\n\n\n\n<p>For example, the following statement finds all employees who have dependents:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-15\" 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<span class=\"hljs-keyword\">FROM<\/span>\n  employees e\n<span class=\"hljs-keyword\">WHERE<\/span>\n  <span class=\"hljs-keyword\">EXISTS<\/span> (\n    <span class=\"hljs-keyword\">SELECT<\/span>\n      <span class=\"hljs-number\">1<\/span>\n    <span class=\"hljs-keyword\">FROM<\/span>\n      dependents d\n    <span class=\"hljs-keyword\">WHERE<\/span>\n      d.employee_id = e.employee_id\n  );<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-15\"><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=U0VMRUNUIGZpcnN0X25hbWUsIGxhc3RfbmFtZSBGUk9NIGVtcGxveWVlcyBlIFdIRVJFIEVYSVNUUyAoIFNFTEVDVCAxIEZST00gZGVwZW5kZW50cyBkIFdIRVJFIGQuZW1wbG95ZWVfaWQgPSBlLmVtcGxveWVlX2lkICk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"156\" height=\"196\" src=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-EXISTS-example.png\" alt=\"SQL Logical Operators - EXISTS example\" class=\"wp-image-1235\" title=\"SQL Logical Operators - EXISTS example\"\/><\/figure>\n\n\n\n<p>Now you should have a brief overview of all SQL logical operators and how to use them to test the truth of a condition. In the next tutorials, you will learn about each logical operator in detail.<\/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=\"1221\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\"\n\t\t\t\tdata-post-title=\"SQL Logical Operators\"\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=\"1221\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\"\n\t\t\t\tdata-post-title=\"SQL Logical Operators\"\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 introduces you to the SQL logical operators and how to use them to test for the truth of a condition.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":58,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1221","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 Logical Operators<\/title>\n<meta name=\"description\" content=\"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.\" \/>\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-logical-operators\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Logical Operators\" \/>\n<meta property=\"og:description\" content=\"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-19T09:13:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png\" \/>\n\t<meta property=\"og:image:width\" content=\"209\" \/>\n\t<meta property=\"og:image:height\" content=\"137\" \/>\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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\",\"url\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\",\"name\":\"SQL Logical Operators\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltutorial.org\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png\",\"datePublished\":\"2018-01-17T03:42:05+00:00\",\"dateModified\":\"2025-01-19T09:13:21+00:00\",\"description\":\"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage\",\"url\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png\",\"contentUrl\":\"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png\",\"width\":209,\"height\":137,\"caption\":\"SQL Logical Operators - AND example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltutorial.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Logical Operators\"}]},{\"@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 Logical Operators","description":"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.","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-logical-operators\/","og_locale":"en_US","og_type":"article","og_title":"SQL Logical Operators","og_description":"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.","og_url":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/","og_site_name":"SQL Tutorial","article_modified_time":"2025-01-19T09:13:21+00:00","og_image":[{"width":209,"height":137,"url":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/","url":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/","name":"SQL Logical Operators","isPartOf":{"@id":"https:\/\/www.sqltutorial.org\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage"},"image":{"@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png","datePublished":"2018-01-17T03:42:05+00:00","dateModified":"2025-01-19T09:13:21+00:00","description":"This tutorial introduces you to the SQL logical operators and shows you how to use them to test for the truth of a condition.","breadcrumb":{"@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltutorial.org\/sql-logical-operators\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#primaryimage","url":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png","contentUrl":"https:\/\/www.sqltutorial.org\/wp-content\/uploads\/2018\/01\/SQL-Logical-Operators-AND-example.png","width":209,"height":137,"caption":"SQL Logical Operators - AND example"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltutorial.org\/sql-logical-operators\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"SQL Logical Operators"}]},{"@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\/1221","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=1221"}],"version-history":[{"count":0,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/1221\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/media?parent=1221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}