hamburger

The wildcard in a WHERE clause is useful when?

By BYJU'S Exam Prep

Updated on: September 25th, 2023

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:

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium