QuestionQ27

VerifiedUsing Conversion Functions and Conditional Expressions

Review the definition of the CUSTOMERS table:

Question Image

For customers with an income-level value, you want to show the first name and a due amount equal to 5% of their credit limit. Do not display customers whose due amount is null.

Which query should be used?

Explanation

CUST_INCOME_LEVEL IS NOT NULL retains only customers with an income-level value, and CUST_CREDIT_LIMIT IS NOT NULL excludes rows for which CUST_CREDIT_LIMIT * 0.05 would be null. Oracle nulls must be tested with IS NULL or IS NOT NULL; comparisons such as != NULL and <> NULL evaluate to UNKNOWN rather than identifying non-null values. Oracle Database SQL Language Reference: Nulls

Learn more

Community Discussion

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