QuestionQ51

VerifiedRestricting and Sorting Data

Examine the description of the CUSTOMERS table:

Question Image

You must display the last names and credit limits for every customer whose last name begins with A or B, in either lowercase or uppercase, and whose credit limit is less than 1000.

Examine this partial query:

Question Image

Which two WHERE conditions produce the required result?

Choose two
Explanation

UPPER(cust_last_name) LIKE 'A%' OR UPPER(cust_last_name) LIKE 'B%' case-folds the last name so values beginning with A or B in any letter case are matched, and INITCAP(cust_last_name) capitalizes the first letter so the same LIKE 'A%' and LIKE 'B%' patterns apply; each condition then restricts the credit limit to values below 1000. IN ('A%', 'B%') performs equality comparisons, treating the percent signs literally rather than as wildcards; LIKE INITCAP('A') contains no wildcard and can match only a single-character name; and BETWEEN UPPER('A%' AND 'B%') is not a valid comparison because UPPER accepts a single argument and BETWEEN performs no pattern matching.

Learn more

Community Discussion

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