CREATE TABLE Department (
  DEPTNO INTEGER PRIMARY KEY,
  DNAME VARCHAR(14),
  LOC VARCHAR(13),
  Version INTEGER DEFAULT 0
);

INSERT INTO Department(DEPTNO, DNAME, LOC) VALUES (10,'ACCOUNTING','NEW YORK');
INSERT INTO Department(DEPTNO, DNAME, LOC) VALUES (20,'RESEARCH','DALLAS');
INSERT INTO Department(DEPTNO, DNAME, LOC) VALUES (30,'SALES','CHICAGO');
INSERT INTO Department(DEPTNO, DNAME, LOC) VALUES (40,'OPERATIONS','BOSTON');

CREATE TRIGGER "DepartmentAfterUpdate" AFTER UPDATE ON "Department"
BEGIN
UPDATE  Department
SET     Version = Version + 1
WHERE   ROWID = new.ROWID;
END;