Which statement accomplishes all the required tasks?

The CUSTOMERS table has the following structure:

You need to write a query that does the following task:
* Display the first name and tax amount of the customers. Tax is 5% of their credit limit
* Only those customers whose income level has a value should be considered
* Customers whose tax amount is null should not be considered
Which statement accomplishes all the required tasks?

The CUSTOMERS table has the following structure:

You need to write a query that does the following task:
* Display the first name and tax amount of the customers. Tax is 5% of their credit limit
* Only those customers whose income level has a value should be considered
* 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 *


Bina

Bina

Ans C
Tax_amount can’t be an expression.

Josh

Josh

C can’t be the answer, you can’t ask for a null that way, you need to use ‘is null’ or ‘is not null’

JTS

JTS

another example

create table emp_news(emple constraint nameprymarykey primary key,nombre)as select employee_id,first_name from employees

RT

RT

The question is about tax_amount, so it cant be B. Therefore, it’s definitely A.

mirac

mirac

yeah, but tax_amount is not a column, it has been defined later..therefore you need to check cust_credit_limit in where clause…

Bogdan

Bogdan

A is the correct ans.
Customers whose tax amount is null should not be considered