{"id":20689,"date":"2021-02-08T06:54:21","date_gmt":"2021-02-08T14:54:21","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=20689"},"modified":"2023-12-01T04:08:53","modified_gmt":"2023-12-01T12:08:53","slug":"sql-or-and-and","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/","title":{"rendered":"SQL OR and SQL AND Statements"},"content":{"rendered":"\n<p><em>The SQL OR statement returns records who meet one of many specified conditions in a WHERE statement. The AND statement returns records who meet all the specified conditions. Both clauses use the syntax: WHERE condition AND\/OR condition&#8230;;<\/em><\/p>\n\n\n\n<p><a href=\"https:\/\/careerkarma.com\/blog\/how-long-to-learn-sql\/\">S<\/a>Q<a href=\"https:\/\/careerkarma.com\/blog\/how-long-to-learn-sql\/\">L<\/a> WHERE statements select records from a table based on a particular condition. You don\u2019t have to limit your WHERE statement to just one condition. You can specify as many conditions as you want.<\/p>\n\n\n\n<p>That\u2019s where the SQL OR and AND operators come in. The OR statement checks whether one of two conditions is met. The AND operator checks whether two or more conditions are met.<\/p>\n\n\n\n<p>In this guide, we\u2019re going to talk about how to use the SQL AND and OR operators. We\u2019ll walk through an example of each of these operators to help you get started. Without further ado, let\u2019s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the SQL AND Statement?<\/h2>\n\n\n\n<p>The SQL AND operator returns all the records that meet the conditions linked by the AND operator. To use the AND operator, you must specify at least two conditions in a WHERE statement.<\/p>\n\n\n\n<p>Let\u2019s take a look at the syntax of the AND operator:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>SELECT column1, column2\nFROM table\nWHERE condition1 AND condition2;\n<\/pre><\/div>\n\n\n\n<p>The AND statement is used after the first statement in an <a href=\"https:\/\/careerkarma.com\/blog\/sql-where\/\">SQL WHERE clause<\/a>. This query will only return records which meet both condition1 and condition2.<\/p>\n\n\n\n<p>You can use the WHERE clause on <a href=\"https:\/\/careerkarma.com\/blog\/sql-select\/\">SQL SELECT<\/a>, <a href=\"https:\/\/careerkarma.com\/blog\/sql-update\/\">SQL UPDATE<\/a>, and <a href=\"https:\/\/careerkarma.com\/blog\/sql-delete-row\/\">SQL DELETE<\/a> statements. This means that you can select, update, and delete records based on multiple conditions with the AND statement.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AND SQL Example<\/h3>\n\n\n\n<p>We have a database that stores information on the employees who work at a pharmaceutical sales company. <\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td><strong>id<\/strong><\/td><td><strong>name<\/strong><\/td><td><strong>title<\/strong><\/td><td><strong>branch<\/strong><\/td><td><strong>salary<\/strong><\/td><\/tr><tr><td>1<\/td><td>Thomas Carlton<\/td><td>Sales Representative<\/td><td>Cambridge<\/td><td>29400<\/td><\/tr><tr><td>2<\/td><td>Lisa Nelson<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>3<\/td><td>Victoria Carlisle<\/td><td>Sales Director<\/td><td>Cambridge<\/td><td>37800<\/td><\/tr><tr><td>4<\/td><td>Michael Jeeves<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>5<\/td><td>Julie Forsythe<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>6<\/td><td>Hallie Peters<\/td><td>Sales Representative<\/td><td>Los Angeles<\/td><td>29400<\/td><\/tr><tr><td>7<\/td><td>Rachel Parsons<\/td><td>Sales Representative<\/td><td>San Francisco<\/td><td>29400<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>We have been asked by the HR department to return a list of the employees who:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Work at the San Francisco branch.<\/li><li>Earn at least $30,000 per year.<\/li><\/ul>\n\n\n\n<p>To retrieve this information, we need to add conditions which relate to two fields in our database. The &#8220;branch&#8221; column stores the name of the branch at which an employee words. &#8220;salary&#8221; stores how much each employee earns per year.<\/p>\n\n\n\n<p>To retrieve records matching our description, we can use the AND operator:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>SELECT * FROM employees\nWHERE branch = 'San Francisco' and salary &gt; 30000;\n<\/pre><\/div>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td><strong>id<\/strong><\/td><td><strong>name<\/strong><\/td><td><strong>title<\/strong><\/td><td><strong>branch<\/strong><\/td><td><strong>salary<\/strong><\/td><\/tr><tr><td>2<\/td><td>Lisa Nelson<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>4<\/td><td>Michael Jeeves<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>5<\/td><td>Julie Forsythe<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Our database returns a list of all employees who work in the San Francisco branch and who earn over $30,000 per year.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the SQL OR Statement?<\/h2>\n\n\n\n<p>The SQL OR operator returns all the records that meet one of a set of specified conditions. You can specify as many conditions as you want with an OR statement. The OR operator comes after a condition in a WHERE clause.<\/p>\n\n\n\n<p>The syntax for the OR SQL operator is the same as the AND operator:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>SELECT column\nFROM table\nWHERE condition1 OR condition2;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">OR SQL Example<\/h3>\n\n\n\n<p>Let&#8217;s return to the database of employees who work at a pharmaceutical sales company. We have been asked to produce a list of all employees who are either Sales Representatives or Senior Sales Representatives. <\/p>\n\n\n\n<p>These employees need to be notified of the latest compensation changes. To retrieve the records of all of these employees, we could use the following command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>SELECT * FROM employees\nWHERE title = &quot;Sales Representative&quot; OR title = &quot;Senior Sales Representative&quot;;\n<\/pre><\/div>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td><strong>id<\/strong><\/td><td><strong>name<\/strong><\/td><td><strong>title<\/strong><\/td><td><strong>branch<\/strong><\/td><td><strong>salary<\/strong><\/td><\/tr><tr><td>1<\/td><td>Thomas Carlton<\/td><td>Sales Representative<\/td><td>Cambridge<\/td><td>29400<\/td><\/tr><tr><td>2<\/td><td>Lisa Nelson<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>4<\/td><td>Michael Jeeves<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>5<\/td><td>Julie Forsythe<\/td><td>Senior Sales Representative<\/td><td>San Francisco<\/td><td>32000<\/td><\/tr><tr><td>6<\/td><td>Hallie Peters<\/td><td>Sales Representative<\/td><td>Los Angeles<\/td><td>29400<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Our database returns five records. All the records that have been returned match employees whose title is either Sales Representative or Senior Sales Representative.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using the SQL AND and OR Operators<\/h2>\n\n\n\n<p>You can use both the AND and OR SQL operators.  This allows you to create more complex SQL queries and commands that evaluate multiple different statements.<\/p>\n\n\n\n<p>We have been asked by the HR department to produce another list of records. We need to retrieve a list of all employees who:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Are Sales Representatives AND<\/li><li>Work in Los Angeles or Cambridge.<\/li><\/ul>\n\n\n\n<p>These employees need to be notified of a new product that is going to be added to their routes. We can find these employees using both the SQL AND and OR operators:\n<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>SELECT * FROM employees\nWHERE title = 'Sales Representative'\nAND (branch = 'Los Angeles' OR branch = 'Cambridge');\n<\/pre><\/div>\n\n\n\n<p>Let&#8217;s run our query and see what happens:<\/p>\n\n\n\n<table class=\"wp-block-table course-info-table\"><tbody><tr><td><strong>id<\/strong><\/td><td><strong>name<\/strong><\/td><td><strong>title<\/strong><\/td><td><strong>branch<\/strong><\/td><td><strong>salary<\/strong><\/td><\/tr><tr><td>1<\/td><td>Thomas Carlton<\/td><td>Sales Representative<\/td><td>Cambridge<\/td><td>29400<\/td><\/tr><tr><td>6<\/td><td>Hallie Peters<\/td><td>Sales Representative<\/td><td>Los Angeles<\/td><td>29400<\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Our query only returns two values. These are the only two records that have the title Sales Representative and who work at either the Los Angeles or Cambridge branches.<\/p>\n\n\n\n<p>Notice that we enclosed the second condition &#8212; whether an employee works at the Los Angeles or Cambridge branch &#8212; in parentheses. Without the parenthesis, our database would interpret our statement as:<\/p>\n\n\n\n<p><em>Select all the records from employees whose title is Sales Representative and who work at the Los Angeles branch. Or, return all records of the employees who work at the Cambridge Branch.<\/em><\/p>\n\n\n\n<p>The parenthesis group our two branch statements together. So, we will only see employees who are Sales Representatives and who work at a specified branch.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The SQL AND operator returns the records that meet two or more conditions. An SQL OR operator returns records that meet one of many conditions. Both statements are used in WHERE clauses.<\/p>\n\n\n\n<p>Are you interested in learning more about SQL? Check out our <a href=\"https:\/\/careerkarma.com\/blog\/learn-sql\/\">How to Learn SQL<\/a> guide. This guide contains top tips on how to learn SQL and a list of learning resources to help you advance your SQL knowledge.<\/p>\n","protected":false},"excerpt":{"rendered":"The SQL OR statement returns records who meet one of many specified conditions in a WHERE statement. The AND statement returns records who meet all the specified conditions. Both clauses use the syntax: WHERE condition AND\/OR condition...; SQL WHERE statements select records from a table based on a particular condition. You don\u2019t have to limit&hellip;","protected":false},"author":240,"featured_media":15988,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17284],"tags":[],"class_list":{"0":"post-20689","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-sql"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"SQL","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>SQL OR and SQL AND Statements | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL OR and SQL AND Statements\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-08T14:54:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T12:08:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"SQL OR and SQL AND Statements\",\"datePublished\":\"2021-02-08T14:54:21+00:00\",\"dateModified\":\"2023-12-01T12:08:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\"},\"wordCount\":957,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg\",\"articleSection\":[\"SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\",\"name\":\"SQL OR and SQL AND Statements | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg\",\"datePublished\":\"2021-02-08T14:54:21+00:00\",\"dateModified\":\"2023-12-01T12:08:53+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg\",\"width\":1020,\"height\":680,\"caption\":\"Coding SQL in a PHP file on a laptop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL\",\"item\":\"https:\/\/careerkarma.com\/blog\/sql\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL OR and SQL AND Statements\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"SQL OR and SQL AND Statements | Career Karma","description":"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.","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:\/\/careerkarma.com\/blog\/sql-or-and-and\/","og_locale":"en_US","og_type":"article","og_title":"SQL OR and SQL AND Statements","og_description":"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.","og_url":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-02-08T14:54:21+00:00","article_modified_time":"2023-12-01T12:08:53+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"SQL OR and SQL AND Statements","datePublished":"2021-02-08T14:54:21+00:00","dateModified":"2023-12-01T12:08:53+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/"},"wordCount":957,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg","articleSection":["SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/","url":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/","name":"SQL OR and SQL AND Statements | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg","datePublished":"2021-02-08T14:54:21+00:00","dateModified":"2023-12-01T12:08:53+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn how to use the SQL OR and SQL AND statements. These are logical operators that check whether one of many or all of a range of conditions are met.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/sql-or-and-and\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/05\/caspar-camille-rubin-fPkvU7RDmCo-unsplash.jpg","width":1020,"height":680,"caption":"Coding SQL in a PHP file on a laptop"},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/sql-or-and-and\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"SQL","item":"https:\/\/careerkarma.com\/blog\/sql\/"},{"@type":"ListItem","position":3,"name":"SQL OR and SQL AND Statements"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/20689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=20689"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/20689\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/15988"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=20689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=20689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=20689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}