
// CF 7-8

// Incumbents table

CREATE TABLE Incumbents (
                        SSN             integer,
                        PCN             integer,
                        StartDate       date,
                        EndDate         date,
                        PRIMARY KEY (SSN, PCN)
                        );

// Actual insert

UPDATE Incumbents
   SET EndDate = DATE '12/05/1997'
 WHERE SSN = 11122333
   AND PCN = 341288
   AND EndDate >= DATE '12/05/1997'
   AND StartDate < DATE '12/05/1997';

DELETE
  FROM Incumbents
 WHERE SSN = 11122333
   AND PCN = 341288
   AND StartDate > DATE '12/05/1997';

