Exam 1z0-082 All QuestionsBrowse all questions from this exam
Question 36

Examine the description of the CUSTOMERS table:

For customers whose income level has a value, you want to display the first name and due amount as 5% of their credit limit. Customers whose due amount is null should not be displayed.

Which query should be used?

    Correct Answer: E

    To display the first name and due amount of customers whose income level has a value, and ensure that customers whose due amount is null are not displayed, we need to use the correct operators and logic in the query. The correct operator to check for null values is 'IS NOT NULL'. The correct query should therefore verify that both 'cust_income_level' and 'cust_credit_limit' are not null. This is because if 'cust_credit_limit' is null, the calculated 'due_amount' will also be null. Thus, the correct option is to check 'cust_income_level IS NOT NULL' and 'cust_credit_limit IS NOT NULL' to filter out rows where the credit limit (and hence due amount) is null. Therefore, the correct answer is the query provided in option E.

Discussion
BorisloneOption: E

E is correct

Ekos

i agree

Guhborges

I agree

nautil2Option: E

A - FALSE; returns error 'ORA-00904: "DUE_AMMOUNT": invalid identifier'. Conditions in WHERE clause are evaluated before column names between SELECT and FROM, so expression alias DUE_AMMOUNT is not known and error is returned. B - FALSE; != is not a valid operator for handling with NULL values. No rows are returned when this operator is used. C - FALSE; <> is not a valid operator for handling with NULL values. No rows are returned when this operator is used. D - FALSE; same asnwer as B E - TRUE; IS NOT NULL is a valid operator, it is applied on both cust_income_level column and cust_credit_limit column. The other column is a source for computate DUE_AMMOUNT value. When a value of cust_credit_limit is NULL, then also DUE_AMMOUNT is null and therefore the appropriate row is not displayed.

algerianphoenixOption: E

E, You can only filter by NULL using 'IS NULL' or 'IS NOT NULL'.

brolemOption: A

A is the correct answer. E does not address the fact that customer's with a due_amount of null should not be displayed

LrnsTgh

it is impossible WHERE clause used alias column. A is wrong.

Oracle2020Option: E

Column aliases can only be referenced within order by, but nowhere else like where, group by or having. That is why the correct answer is E

zouveOption: A

A. SELECT cust_first_name, cust_credit_limit * .05 AS DUE_AMOUNT FROM customers WHERE cust_income_level IS NOT NULL AND due_amount IS NOT NULL; This query selects the cust_first_name and calculates the DUE_AMOUNT as 5% of the cust_credit_limit from the customers table. The WHERE clause filters the rows to include only those where the cust_income_level is not null and the due_amount is not null. This means that only customers whose income level has a value and whose due amount is not null will be displayed in the result.

raferen10Option: E

E is correct , IS NULL/IS NOT NULL is used to compare nulls (discard B,C,D),and due_amount is a alias columns cannot be used in where ( discard A) , only posible option is E

AramazdOption: E

there is not due_amount in the table. So E is correct

ryuahOption: E

E is correct