Search code examples
relational-algebra

SQL/relational algebra and date != string error


Trying to display names and dates of Iowa ships that have had least one battle in the year 1943 or later. However, every time I go to use date under the Battles table I can not compare it to a date ('YYYY-DD-MM').

This is what it keeps showing

This is what it keeps showing


Solution

  • You had to cast your string representation of date as actual date data type: (π name σ class = 'Iowa' (Ships)) ⨝ (π date σ date > date('1943-01-01') (Battles))