/* like operator */ -- The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. -- There are two wildcards often used in conjunction with the LIKE operator: -- The percent sign (%) represents zero, one, or multiple characters -- The underscore sign (_) represents one, single character -- LIKE Syntax : SELECT column1, column2 FROM table_name WHERE columnN LIKE pattern; create table employee(EmpID int, EmpFirstName varchar(255),EmpLastName varchar(255),Address varchar(255),salary int); insert into employee(EmpID, EmpFirstName, EmpLastName, Address, Salary) values(1,"John","Doe","Delhi",10000), (2,"Collins","john","Chandigarh",20000), (3,"Johny","Doey","Delhi",10000), (4,"Collinsy","johny","Chandigarh",20000), (5,"Harryy","Jonesy","Delhi",15000); ----------------------------- select EmpFirstName,EmpLastName, Address from employee where address like 'D%'; select EmpFirstName,EmpLastName, Address from employee where address like "%h"; select EmpFirstName,EmpLastName, Address from employee where address like "%i"; select EmpFirstName,EmpLastName, Address from employee where address like "%el%"; select EmpFirstName,EmpLastName, Address from employee where address like "_h%"; select EmpFirstName,EmpLastName, Address from employee where address like "_a%";
To embed this project on your website, copy the following code and paste it into your website's HTML: