Examveda
Examveda

Which operator performs pattern matching?

A. BETWEEN operator

B. LIKE operator

C. EXISTS operator

D. None of these

Answer: Option B

Solution(By Examveda Team)

LIKE is a keyword that is used in the WHERE clause. Basically, LIKE allows us to do a search based operation on a pattern rather than specifying exactly what is desired (as in IN) or spell out a range (as in BETWEEN).

The syntax is as follows:
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}

{PATTERN} often consists of wildcards. In SQL, there are two wildcards:

  • 1=% (percent sign) represents zero, one, or more characters.
  • 2=_ (underscore) represents exactly one character.

Join The Discussion

Related Questions on Sql Miscellaneous

What does the following query find?
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'red')
MINUS
(SELECT DISTINCT r.sid
FROM boats b, reserves r
WHERE b.bid = r.bid
AND b.color = 'green')

A. Find the sailor IDs of all sailors who have reserved red boats but not green boats

B. Find the sailor IDs of at least one sailor who have reserved red boats but not green boats

C. Find the sailor Ids of atmost one sailor who have reserved red boats but not green boats

D. None of These