CREATE TABLE products (ID int primary key, name varchar, type varchar)
CREATE TABLE contracts (ID int primary key, product int, revenue decimal, dateSigned date)
CREATE TABLE revenueRecognitions (contract int, amount decimal, recognizedOn date, 
	   PRIMARY KEY(contract, recognizedOn))

CREATE PROCEDURE INSERT_RECOGNITION
(IN contractID int, IN amount decimal, IN recognizedOn date, OUT result int)
LANGUAGE SQL
BEGIN
	INSERT INTO revenueRecognitions VALUES( contractID, amount, recognizedOn);
	SET result = 1;
END

CREATE TRIGGER reminder1
ON Contracts.revenueRecognitions
AFTER INSERT, UPDATE 
AS RAISERROR ('Notify Sales', 16, 10)
GO