DE are correct.
Precedence
Precedence is the order in which Oracle evaluates different operators in the same expression. When evaluating an expression containing multiple operators, Oracle evaluates operators with higher precedence before evaluating those with lower precedence. Oracle evaluates operators with equal precedence from left to right within an expression.
https://docs.oracle.com/cd/A87860_01/doc/server.817/a85397/operator.htm
A - false; concatenation, addition and subtraction has the same precedence, in that case it is evaluated from left to right within an expression.
B - false; precedence does not change, result is NULL except of concatenation
C - false; only unary +, unary -, PRIOR, CONNECT_BY_ROOT and COLLATE have the highest precedence
D - true; see A
E - true; You can use parentheses in an expression to override operator precedence. Oracle evaluates expressions inside parentheses before evaluating those outside.
Source: Oracle documentation: Release 19, SQL Language Reference, 4 Operators, About SQL Operators
Rules of precedence:
1. arithmetic operators
2. concatenation operator
3. comparison conditions
4. is (NOT) NULL, LIKE (NOT) IN
5. (NOT) Between
6. NOT equal to
7. NOT logical operatror
8. AND logical operatror
9. OR logical operatror
C & E is correct.
+ has the higher precedence.
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/About-SQL-Operators.html#GUID-FEF44762-F45C-41D9-B380-F6A61AD25338
D and E are obviously correct BUT, since this was too strange of a mistake to be true, I went and review the precedence rules, finding out something I honestly forgot or ignored altogether:
"+" IS, actually, the operator with the highest precedence, together with "-", yet only when they're used a unary operators "identity" and "negation".
For example, in a simple operation +X*Y, the "+" is the first operator evaluated.
As a binary operator it still comes, obviously, after multiplication and division, I've just been thinking that in a similar question where they could state "unary", I could have easily been tricked overlooking that simple detail.
https://docs.oracle.com/cd/A87860_01/doc/server.817/a85397/operator.htm#997667
please check on the same link.
Precedence Example
In the following expression, multiplication has a higher precedence than addition, so Oracle first multiplies 2 by 3 and then adds the result to 1.
1+2*3
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.
husseinyounes
Highly Voted 3 years, 7 months agoEkos
3 years, 1 month agoTrowa
Highly Voted 3 years, 5 months agonautil2
Most Recent 2 months, 3 weeks agoOracle2020
4 months, 2 weeks agoauwia
6 months, 1 week agoauwia
6 months agoKuraudio
1 year, 1 month agocasfdsaf
1 year, 10 months agoryuah
2 years agoGuhborges
2 years, 4 months agoemburria
1 year, 11 months agoGuhborges
1 year, 11 months agoSimoneF
3 years agoJoejoel
2 years, 1 month agoDatajimm
1 year, 10 months agoavanand
3 years, 4 months agoyou1234
3 years, 6 months agodanito
3 years, 7 months ago