
/* Code Fragment 6.3 Bob was assigned the position of Associate Director of the Computer center, also ensuring referential integrity, in the restricted case. */

INSERT INCUMBENTS
SELECT '111-22-3333','999071', GETDATE(), '3000-01-01'
FROM INCUMBENTS
WHERE NOT EXISTS (	SELECT *
			FROM INCUMBENTS AS I2
			WHERE I2.SSN = '111-22-3333'
			AND I2.END_DATE = '3000-01-01')
	AND EXISTS (SELECT *
			FROM POSITIONS
			WHERE POSITIONS.PCN = '999071'
			AND POSITIONS.END_DATE = '3000-01-01')
