{"id":66,"date":"2026-03-06T06:08:06","date_gmt":"2026-03-06T06:08:06","guid":{"rendered":"https:\/\/gigz.pk\/sql\/?post_type=lesson&#038;p=66"},"modified":"2026-03-16T18:49:04","modified_gmt":"2026-03-16T18:49:04","slug":"and-or-not","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/","title":{"rendered":"\u00a0AND, OR, NOT"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Logical operators are used to combine or modify conditions. They help computers and programs make decisions based on different situations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AND<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>AND<\/strong> operator is used when two or more conditions must be true at the same time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If all conditions are true, the result will be true.<br>If one condition is false, the result will be false.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example<br>If a student studies AND completes homework, the teacher gives good remarks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another Example<br>If a number is greater than 5 AND less than 10, it lies between 6 and 9.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OR<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>OR<\/strong> operator is used when at least one condition must be true.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If one condition is true, the result will be true.<br>If both conditions are false, the result will be false.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example<br>A student can join the class if he submits the assignment OR gets permission from the teacher.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another Example<br>A number is accepted if it is equal to 5 OR equal to 10.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">NOT<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>NOT<\/strong> operator is used to reverse the condition. It changes true into false and false into true.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example<br>If it is NOT raining, we will go outside to play.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another Example<br>If a student is NOT present, he will be marked absent.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">AND requires all conditions to be true.<br>OR requires at least one condition to be true.<br>NOT changes the meaning of the condition to its opposite.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/sql\/\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">SQL Foundations Program (SQL-101) > Filtering &#038; Conditions > AND, OR, NOT<\/span><\/span><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"menu_order":14,"template":"","class_list":["post-66","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u00a0AND, OR, NOT - SQL Learning Hub<\/title>\n<meta name=\"description\" content=\"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u00a0AND, OR, NOT - SQL Learning Hub\" \/>\n<meta property=\"og:description\" content=\"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Learning Hub\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T18:49:04+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/and-or-not\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/and-or-not\\\/\",\"name\":\"\u00a0AND, OR, NOT - SQL Learning Hub\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/#website\"},\"datePublished\":\"2026-03-06T06:08:06+00:00\",\"dateModified\":\"2026-03-16T18:49:04+00:00\",\"description\":\"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/and-or-not\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/and-or-not\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/and-or-not\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Foundations Program (SQL-101) > Filtering & Conditions > AND, OR, NOT\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/\",\"name\":\"SQL Learning Hub\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/?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":"\u00a0AND, OR, NOT - SQL Learning Hub","description":"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.","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:\/\/gigz.pk\/sql\/lesson\/and-or-not\/","og_locale":"en_US","og_type":"article","og_title":"\u00a0AND, OR, NOT - SQL Learning Hub","og_description":"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.","og_url":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/","og_site_name":"SQL Learning Hub","article_modified_time":"2026-03-16T18:49:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/","url":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/","name":"\u00a0AND, OR, NOT - SQL Learning Hub","isPartOf":{"@id":"https:\/\/gigz.pk\/sql\/#website"},"datePublished":"2026-03-06T06:08:06+00:00","dateModified":"2026-03-16T18:49:04+00:00","description":"Learn logical operators AND, OR, and NOT with simple explanations and examples. Understand programming conditions easily.","breadcrumb":{"@id":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/sql\/lesson\/and-or-not\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/sql\/"},{"@type":"ListItem","position":2,"name":"SQL Foundations Program (SQL-101) > Filtering & Conditions > AND, OR, NOT"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/sql\/#website","url":"https:\/\/gigz.pk\/sql\/","name":"SQL Learning Hub","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/sql\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/lesson\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/sql\/wp-json\/wp\/v2\/media?parent=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}