# Relational Algebra - 4

# Relational Algebra - 4

Steven42 + 0 comments Another incorrect and/or ambiguous question answer. As already stated in past comments, the answer is only correct if all operators are of the same precedence.

So, HackerRank - why aren't these questions reviewed before they are released? Also, why does it take over a year to correct an error?

L0r3nz0 + 1 comment In this source, p21 for example, there exists a precedence order between the set operators, which means that the operations are not necessarily evaluated from left to right. Did anyone verify the answers marked as correct?

ekta_yadav995 + 1 comment if there are operators of the same precedence in the expression, the operation is performed left to right for example, (a++ *2 )+ (a-- * 2);

it'll result in 2 differnt answers if performed in opposite directions

christine_e_hill + 0 comments This question is not written in clear and precise English. Evaluation is from left to right only after the precedence rules are considered. For more, please see here:

"Precedence is a simple ordering, based on either the importance or sequence. In relational algebra, the unary operators Π, σ and ρ have the highest precedence. Next highest is the Cartesian product operator × followed by the join operators ✶, A./ and ./@. The set difference operator − is evaluated next. Finally are the operators ∪ and ∩. This is the default precedence."

aiswarya110498 + 0 comments Left to right is the correct answer for this question..

Precedence of the set of operations is basically performed in left to right.

mvsmaneesh + 0 comments left to rigth

gofractal + 0 comments After however many years, this question is still incorrect, in terms of the expected answer. There is nothing stating whether the expression has operators of different precedences, or whether there are any parentheses to be considered.

If the question is not updated to provide more information, then the correct answer should be changed to

**Depends on the Expression**.

ramey_steven + 0 comments I agree with everyone below that this problem & answer are sub-par and likely incorrect.

We probably need to modify / adjust this problem to not be so simplistic in the answer...there is a pretty involved discussion here on stackexchange about set operator precedence and how parentheses are needed to disambiguate the order of operations.... it does not appear to be as simple as left to right:

https://math.stackexchange.com/questions/266182/order-of-precedence-of-set-operators

No more comments

Sort 8 Discussions, By:

Please Login in order to post a comment