
/* Code Fragment 6.17 Bob was promoted to Director of the Computer Center for 1997. */

INSERT INTO INCUMBENTS
SELECT '111-22-3333', PCN, '01/01/1998', END_DATE
FROM INCUMBENTS
WHERE SSN = '111-22-3333'
      AND START_DATE <= '01/01/1998'
      AND END_DATE > '01/01/1998'

INSERT INTO INCUMBENTS
SELECT '111-22-3333', PCN, START_DATE, '01/01/1997'
FROM INCUMBENTS
WHERE SSN = '111-22-3333'
      AND START_DATE <= '01/01/1997'
      AND END_DATE > '01/01/1997'

UPDATE INCUMBENTS 
SET PCN = '908739'
WHERE SSN = '111-22-3333'
      AND START_DATE <= '01/01/1998'
      AND END_DATE > '01/01/1997'

UPDATE INCUMBENTS 
SET START_DATE = '01/01/1997'
WHERE SSN = '111-22-3333'
      AND START_DATE < '01/01/1997'
      AND END_DATE > '01/01/1997'

UPDATE INCUMBENTS 
SET END_DATE = '01/01/1998'
WHERE SSN = '111-22-3333'
      AND START_DATE < '01/01/1998'
      AND END_DATE > '01/01/1998'
