exam questions

Exam 1z0-082 All Questions

View all questions & answers for the 1z0-082 exam

Exam 1z0-082 topic 1 question 36 discussion

Actual exam question from Oracle's 1z0-082
Question #: 36
Topic #: 1
[All 1z0-082 Questions]

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?

  • 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;
  • B. SELECT cust_first_name, cust_credit_limit * .05 AS DUE_AMOUNT FROM customers WHERE cust_income_level != NULL AND cust_credit_level !=NULL;
  • C. SELECT cust_first_name, cust_credit_limit * .05 AS DUE_AMOUNT FROM customers WHERE cust_income_level <> NULL AND due_amount <> NULL;
  • D. SELECT cust_first_name, cust_credit_limit * .05 AS DUE_AMOUNT FROM customers WHERE cust_income_level != NULL AND due_amount != NULL;
  • E. SELECT cust_first_name, cust_credit_limit * .05 AS DUE_AMOUNT FROM customers WHERE cust_income_level IS NOT NULL AND cust_credit_limit IS NOT NULL;
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Borislone
Highly Voted 4 years, 3 months ago
E is correct
upvoted 13 times
Ekos
4 years ago
i agree
upvoted 2 times
...
Guhborges
3 years, 1 month ago
I agree
upvoted 1 times
...
...
MoreC
Most Recent 1 month, 3 weeks ago
E. cust_income_level IS NOT NULL AND cust_credit_limit IS NOT NULL – This is incorrect because the WHERE clause needs to filter based on due_amount IS NOT NULL, not cust_credit_limit IS NOT NULL.
upvoted 1 times
...
Oracle2020
9 months, 2 weeks ago
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
upvoted 2 times
...
nautil2
1 year, 3 months ago
Selected Answer: 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.
upvoted 3 times
...
zouve
1 year, 5 months ago
Selected Answer: 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.
upvoted 1 times
...
raferen10
2 years, 1 month ago
Selected Answer: 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
upvoted 1 times
...
algerianphoenix
2 years, 7 months ago
E, You can only filter by NULL using 'IS NULL' or 'IS NOT NULL'.
upvoted 2 times
...
Aramazd
2 years, 9 months ago
there is not due_amount in the table. So E is correct
upvoted 1 times
...
ryuah
3 years ago
E is correct
upvoted 1 times
...
brolem
3 years, 4 months ago
A is the correct answer. E does not address the fact that customer's with a due_amount of null should not be displayed
upvoted 2 times
LrnsTgh
3 years, 4 months ago
it is impossible WHERE clause used alias column. A is wrong.
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago