SQLite Forum

Sqlite3 Trigger
Login
The code fragment "NOT (SELECT SUM(dauer) FROM fahrstunde WHERE fahrstunde.schueleremail = NEW.email ) >= 180"

will always evaluate to FALSE, so the result of ANDing that with anything will also be FALSE.  This means that the entire condition will always be FALASE, the WHEN clause will always fail (be FALSE) and the RAISE will never be executed.

NOT (something)

will ALWAYS be either 1 (true) or 0 (false)  and 0/1 is NEVER > than 1.