{"id":69,"date":"2026-03-06T06:14:36","date_gmt":"2026-03-06T06:14:36","guid":{"rendered":"https:\/\/gigz.pk\/sql\/?post_type=lesson&#038;p=69"},"modified":"2026-03-16T18:49:19","modified_gmt":"2026-03-16T18:49:19","slug":"like-operator","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/","title":{"rendered":"\u00a0LIKE Operator"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is the LIKE Operator?<\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1773511986574\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>LIKE operator<\/strong> is used in SQL to search for a specific pattern in a column. It allows you to match text using <strong>wildcards<\/strong> instead of exact values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Syntax<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT column1, column2<br>FROM table_name<br>WHERE column_name LIKE pattern;<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>column_name<\/code> \u2013 The column you want to search in<\/li>\n\n\n\n<li><code>pattern<\/code> \u2013 The text pattern to match<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Wildcards Used with LIKE<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>%<\/strong> \u2013 Represents zero, one, or multiple characters\n<ul class=\"wp-block-list\">\n<li>Example: <code>'A%'<\/code> matches any value starting with A<\/li>\n\n\n\n<li>Example: <code>'%son'<\/code> matches any value ending with son<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>_<\/strong> \u2013 Represents a single character\n<ul class=\"wp-block-list\">\n<li>Example: <code>'A_n'<\/code> matches &#8216;Ann&#8217;, &#8216;Aen&#8217;, etc.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example 1: Find names starting with &#8220;J&#8221;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT name<br>FROM students<br>WHERE name LIKE 'J%';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example 2: Find emails ending with &#8220;@gmail.com&#8221;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT email<br>FROM users<br>WHERE email LIKE '%@gmail.com';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example 3: Find words with &#8220;ar&#8221; in the middle<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT product_name<br>FROM products<br>WHERE product_name LIKE '%ar%';<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example 4: Find three-letter names starting with &#8220;A&#8221;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT name<br>FROM employees<br>WHERE name LIKE 'A__';<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Key Points to Remember<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LIKE is <strong>case-insensitive<\/strong> in some databases and <strong>case-sensitive<\/strong> in others.<\/li>\n\n\n\n<li><code>%<\/code> can be used at the beginning, end, or both sides of the pattern.<\/li>\n\n\n\n<li><code>_<\/code> is useful when you want to match a single unknown character.<\/li>\n\n\n\n<li>For exact matches, use <code>=<\/code> instead of LIKE.<\/li>\n<\/ul>\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 > LIKE Operator<\/span><\/span><\/div>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"menu_order":17,"template":"","class_list":["post-69","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>\u00a0LIKE Operator - SQL Learning Hub<\/title>\n<meta name=\"description\" content=\"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.\" \/>\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\/like-operator\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u00a0LIKE Operator - SQL Learning Hub\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Learning Hub\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T18:49:19+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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/like-operator\\\/\",\"url\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/like-operator\\\/\",\"name\":\"\u00a0LIKE Operator - SQL Learning Hub\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/#website\"},\"datePublished\":\"2026-03-06T06:14:36+00:00\",\"dateModified\":\"2026-03-16T18:49:19+00:00\",\"description\":\"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/like-operator\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/like-operator\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/sql\\\/lesson\\\/like-operator\\\/#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 > LIKE Operator\"}]},{\"@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":"\u00a0LIKE Operator - SQL Learning Hub","description":"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.","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\/like-operator\/","og_locale":"en_US","og_type":"article","og_title":"\u00a0LIKE Operator - SQL Learning Hub","og_description":"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.","og_url":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/","og_site_name":"SQL Learning Hub","article_modified_time":"2026-03-16T18:49:19+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/","url":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/","name":"\u00a0LIKE Operator - SQL Learning Hub","isPartOf":{"@id":"https:\/\/gigz.pk\/sql\/#website"},"datePublished":"2026-03-06T06:14:36+00:00","dateModified":"2026-03-16T18:49:19+00:00","description":"Learn how to use the SQL IN operator to filter data efficiently, handle multiple values, and simplify your queries with examples.","breadcrumb":{"@id":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/sql\/lesson\/like-operator\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/sql\/lesson\/like-operator\/#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 > LIKE Operator"}]},{"@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\/69","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=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}