Which statement accomplishes all the required tasks?

Customers whose tax amount is null should not be considered.
Which statement accomplishes all the required tasks?

Customers whose tax amount is null should not be considered.
Which statement accomplishes all the required tasks?

A.
SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUNT FROM customers
WHERE cust_income_level IS NOT NULL AND
tax_amount IS NOT NULL;

B.
SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUNT FROM customers
WHERE cust_income_level IS NOT NULL AND
cust_credit_limit IS NOT NULL;

C.
SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUNT FROM customers
WHERE cust_income_level <> NULL AND
tax_amount <> NULL;

D.
SELECT cust_first_name, cust_credit_limit * .05 AS TAX_AMOUNT FROM customers
WHERE (cust_income_level,tax_amount) IS NOT NULL;



Leave a Reply 7

Your email address will not be published. Required fields are marked *


banu

banu

Synonym cannot be used inside where condition?
or
In this case if cust_credit_limit IS NOT NULL it implies tax_amount will also be NOT NULL?

Justyna

Justyna

Column alias cannot be used in the where clause only column names, expressions, constants.

melese

melese

the statement state about tax amount is null should not be considered
so the answer should ‘A’
why ‘B’?

Satish

Satish

Tax_Amount is alias not a column name. we can not use alias in Where condition

Justyna

Justyna

Tax Amount it is column alias (see comments above)

Biju Sreekumar

Biju Sreekumar

Tax only depends on credit_limit, So no need to check for income_level = null. This is not asked in the question also. Hence the answer should be none of these 🙂