
// CF 6-9

// Incumbents table & data

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

INSERT INTO Incumbents VALUES (
                        111223333,
                        120033,
                        DATE '01/01/1996',
                        DATE '06/01/1996'
                              );

INSERT INTO Incumbents VALUES (
                        111223333,
                        137112,
                        DATE '06/01/1996',
                        DATE '08/01/1996'
                              );

INSERT INTO Incumbents VALUES (
                        111223333,
                        341288,
                        DATE '08/01/1996',
                        DATE '10/01/1996'
                              );

INSERT INTO Incumbents VALUES (
                        111223333,
                        723401,
                        DATE '10/01/1996',
                        DATE '01/01/3000'
                              );

INSERT INTO Incumbents VALUES (
                        444332222,
                        120033,
                        DATE '01/01/1997',
                        DATE '01/01/3000'
                              );


// Actual query

SELECT *
  FROM Incumbents
 ORDER BY PCN

