QuestionQ205

VerifiedRestricting and Sorting Data

Refer to the Exhibit and review the structure of the CUSTOMERS table.

Question Image

You need to generate a report showing the last names and credit limits of all customers whose last names begin with A, B, or C, and whose credit limit is 10,000. Evaluate the following two queries:

Question Image

Question Image

Which statement is true about the execution of these queries?

Explanation

LIKE 'A%', LIKE 'B%', and LIKE 'C%' perform prefix pattern matching, so the first predicate includes each required initial letter. BETWEEN 'A' AND 'C' is equivalent to >= 'A' AND <= 'C' on the complete character value; it is not a prefix match and excludes multi-character values beginning with C. Both statements are valid, but only the first meets the required last-name condition.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!