QuestionQ125

VerifiedRestricting and Sorting Data

The customers table has this structure:

Question Image

Write a query that performs the following tasks:

  1. Display each customer's first name and tax amount. Tax equals 5% of the customer's credit limit.
  2. Consider only customers whose income level has a value.
  3. Exclude customers whose tax amount is null.

Which statement performs all the required tasks?

Question Image

Explanation

cust_income_level IS NOT NULL includes only customers with an income-level value. Because an arithmetic expression containing a null operand evaluates to null, cust_credit_limit IS NOT NULL ensures that cust_credit_limit * .05 produces a non-null tax amount. Oracle permits a select-list alias in ORDER BY, but not in WHERE; null tests must use IS NULL or IS NOT NULL.

Learn more

Community Discussion

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