Fixed ON DELETE clause.
Using modulo operator.