dbis-uibk / relax

RelaX - a relational algebra calculator
http://dbis-uibk.github.io/relax/
MIT License
279 stars 95 forks source link

Division result is not expected #22

Closed medifle closed 4 years ago

medifle commented 5 years ago

Test case:

gist ID: 0c3296418a9053b5132034885511e4d9

Relational Algebra

(π SID, CID (Grade)) ÷ (π SID (Student))

The expected result should be:

Grade.CID
---
CS305

but the actual result is empty

Not sure if my understanding is correct


The interesting thing is, it works for another working example:

(π SID, CID (Grade)) ÷ (π CID (Course))

The expected and actual result is

Grade.SID
---
1000
michaelrampl commented 4 years ago

We are using (R % S) := (pi r'(R)) - pi r'( ( (pi r'(R)) x (S) ) - (R) ) to calculate the Devision.

When using this formula, I was able to find an issue within the subtraction. image

michaelrampl commented 4 years ago

Fixed row equality check for subtraction with 3b587f161e7bd6bf604a19a7240128adc9cb676f