The wildcard in a WHERE clause is useful when?

By Anjnee Bhatnagar|Updated : June 27th, 2022

The wildcard in a WHERE clause is useful when?

  1. An exact match is necessary for a SELECT statement.
  2. An exact match is not possible in a SELECT statement.
  3. An exact match is necessary for a CREAT statement.
  4. An exact match is not possible in a CREATE statement.

Answer: Option B. An exact match is not possible in a SELECT statement.

The wildcard in a WHERE clause is useful when an exact match is not possible in a SELECT statement.

Solution:

The wildcard in a WHERE clause is useful when an exact match is not possible in a SELECT statement. Suppose you want to find all the names starting with “An” then in this case SELECT clause is not sufficient alone. With the help of a wildcard, we can retrieve our desired output.

Example: Find the names of employees from table Emp where fname starts with An?

Answer: The query will be :

SELECT *

FROM Emp

WHERE fname LIKE ‘An%’;

☛ Related Questions:

Comments

write a comment

Follow us for latest updates