Section 19: MySQL - Searching data using LIKE operator

Опубликовано: 12 Февраль 2021
на канале: Rita Jain
133
3

In this tutorial, you will learn how to use the MySQL LIKE operator to query data based on a specified pattern.

Github link for sql quereis
https://github.com/RitaJain/SQL

Syntax :
Select *
from TableName
where Column Name
Like "Search Pattern String"

Learn usage of wild card characters Pearcentage % and Underscore _

MySQL LIKE operator examples

A) Using MySQL LIKE with the percentage (%) wildcard examples
In this example below query will search for those names which starts with ' a'
SELECT
Emp_no,
First_name,
Last_name
FROM
EmployeeDetails
WHERE
First_name LIKE 'a%';
In this example below query will search for those names which ends with ' a'
SELECT
Emp_no,
First_name,
Last_name
FROM
EmployeeDetails
WHERE
Last_name LIKE 'a%';

B) Using MySQL LIKE with underscore( _ ) wildcard examples
Below Query will search for those employee names which starts with T and ends with M
e.g Tim , Tom
SELECT
employeeNumber,
lastName,
firstName
FROM
employees
WHERE
lastname LIKE 'T_m';
See Complete Playlists
SQL for Beginners :https://www.youtube.com/playlist?list...
Interview Questions :   • SQL Interview Questions  
SQL :    • SQL  
Manual Testing :   • Manual Testing  

Connect & Contact Me:
Facebook:   / 874154043395675  
Quora: https://www.quora.com/profile/Rita-Ja...
Instagram:   / ritajainid  
Twitter :  / ritajain1  
Linkedin :  / jainrita  
Website :https://ritajain.wordpress.com/
#ritajainlectures
#freeSQLTutorial
#LikeOperatorMySQL
#wildchardCharacters%and_
#UsageofLikeOperator
#SQLQueryUsingLike
#Query
#dbmstutorials
#databasetesting
#sql
#MySQL
#SQLtutorialfor beginners
#mysqlworkbench