View on GitHub

Relational

Educational tool for relational algebra

Downloads | Screenshots | Query language | Optimizations | Shortcuts |

Types and casting rules

When performing selection, implicit casting will be performed to allow the use of operators other than == and !=.

Rules

According to the regexp, a string like '.3' will not be casted to float. I've never liked this format and hence it is forbidden in relational.

Prevent casting

Consider the following relation:

id product
113 scanner
113a new scanner

The id field of the 1st tuple will be casted to int, but the same field of the 2nd tuple will not be casted. To avoid anomalies in queries dealing with such fields you must prevent implicit casting.
Achieving this is simple, just cast back to string, using str()

Example

σ (str(id).endswith('3')) (products)

Type rdate

Fields

Methods

Objects of type rdate support the operators + - == > < >= <= !=.