参考答案:
CREATE TRIGGER tric_zc
ON 教师表
AFTER INSERT,UPDATE
AS
BEGIN
DECLARE @zc varchar(10),@dept varchar(30)
SET @zc =(SELECT 职称 FROM inserted)
SET @dept =(SELECT 所在部门号 FROM inserted)
IF @zc=‘教授’ OR ‘副教授’
UPDATE 部门表
SET 高级职称人数=高级职称人数+1
WHERE 部门号=@dept
END