exam questions

Exam 1z0-071 All Questions

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

Exam 1z0-071 topic 1 question 22 discussion

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

Which two are true about the precedence of operators and conditions? (Choose two.)

  • A. || has a higher order of precedence than + (addition).
  • B. + (addition) has a higher order of precedence than * (multiplication).
  • C. NOT has a higher order of precedence than AND and OR in a condition.
  • D. AND and OR have the same order of precedence in a condition.
  • E. Operators are evaluated before conditions.
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

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
CyberP
Highly Voted 10 months, 2 weeks ago
The rules are listed in descending order: Parentheses (as well as brackets in lookup expressions and IN expressions). Note that you can freely add parentheses any time you want to impose an alternative precedence or to make precedence clearer. * / + - = <> < > <= >= IS (IS NULL, IS NOT NULL, IS EMPTY, IS NOT EMPTY) BETWEEN NOT AND OR
upvoted 11 times
...
LuisLikes
Most Recent 1 month, 2 weeks ago
Selected Answer: CE
|| (OR) doesn't have a highter order of precedence than + (addition). Here I'll show you why: SELECT 1+1||'1.9' AS addition_operator FROM DUAL; --output: 21.9 SELECT '1.9'||1+1 AS or_condition FROM DUAL; --output: 2.91 In the first SELECT statement is first adding up 1+1 (2) and then concatenating with '1.9', making the output '21.9'. Lastly, the second SELECT statement concatenates '1.9' with 1 ('1.91') and then adding up 1, making the output '2.91'. This proves that, in this case, whatever comes first in the statement will be calculated. If there was an order of precedence, the outputs would've been: OR first: '12.9' (1+(1||'1.9')) and '2.91' (('1.91'||1)+1). + first: '21.9' ((1+1)||'1.9') and '1.92' ('1.9'||(1+1)). So the correct answers are C and E.
upvoted 1 times
...
bignosepig
3 months ago
Selected Answer: AC
|| has a higher order of precedence than + (addition).
upvoted 1 times
...
21b6ee4
4 months ago
Selected Answer: AC
select '9.9'||1+2 from dual Result 11.91 Contamination is done first
upvoted 1 times
Szczurk3y
1 month ago
select '9,9'+1||2 from dual results in 10,92. Meaning both have the same order precedence.
upvoted 1 times
...
...
alic_alex
1 year, 1 month ago
Selected Answer: CE
https://docs.oracle.com/cd/E49933_01/server.770/es_eql/src/ceql_expr_precedence_rules.html#:~:text=The%20rules%20are,the%20JOIN%20operators.
upvoted 1 times
...
dexdinh91
1 year, 3 months ago
Selected Answer: CE
CE is correct
upvoted 2 times
...
holdfaststrongly
1 year, 6 months ago
This Oracle doc explains between OR, AND, and NOT. https://docs.oracle.com/en/database/other-databases/nosql-database/22.2/sqlreferencefornosql/operator-precedence.html
upvoted 2 times
...
AGoodStuff
1 year, 7 months ago
https://www.tutorialspoint.com/plsql/plsql_operators_precedence.htm
upvoted 1 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