explain two wild cards used with like operator
Answers
Answer:
The SQL LIKE operator uses two wildcards, either independently or in conjunction. These wildcards are: Percentage symbol ( % ), represents zero, one, or multiple characters. Underscore symbol ( _ ), represents a single character.
Two wild cards used with the like operator are percentage and underscore.
The LIKE operator is used in SQL in a WHERE clause to find a particular pattern in a table.
One can use two wild cards with the LIKE operator:
1. percentage (%) : It represents 0, 1 or more characters. The syntax for the % wildcard is:
Select Statement…Where column_name LIKE ‘Y%’
For example:
SELECT * FROM students
WHERE studentname LIKE 'm%';
This above given SQL statement will display the details of all the students whose names start with alphabet 'm'.
2. underscore (_) : It represents a single character. The syntax for the _ wildcard is:
Select Statement...Where column_name LIKE 'Y_'
For example:
SELECT * FROM students
WHERE year_of_birth LIKE '198_'
The above given SQL statement will display the details of all the students having year of birth starting from 198 figure. The underscore will be replaced with any one number from 0 to 9.
For related questions and answers:
https://brainly.in/question/21791678
#SPJ6