

/*populating current table and P_TT */


INSERT INTO PROJECTIONS VALUES(1, "A",12, 1, 1, 1)
UPDATE P_TT
SET Start_Date='01/01/1996'
WHERE PROJECTION_ID=1


INSERT INTO PROJECTIONS VALUES(2, "B",10, 1, 1, 1)
UPDATE P_TT 
SET Start_Date='01/01/1996'
WHERE PROJECTION_ID=2


INSERT INTO PROJECTIONS VALUES(3, "C",15, 1, 1, 1)
UPDATE P_TT 
SET Start_Date='01/01/1996'
WHERE PROJECTION_ID=3


INSERT INTO PROJECTIONS VALUES(4, "D",17, 1, 1, 1)
UPDATE P_TT 
SET Start_Date='01/01/1996'
WHERE PROJECTION_ID=4


INSERT INTO PROJECTIONS VALUES(5, "E",18, 1, 1, 1)
UPDATE P_TT 
SET Start_Date='01/01/1996'
WHERE PROJECTION_ID=5


DELETE FROM PROJECTIONS WHERE PROJECTION_ID=5 
UPDATE P_TT 
SET Stop_Date='02/3/1996' 
WHERE PROJECTION_ID=5 
AND 
	(Stop_Date=(	SELECT MAX(Stop_Date) 
			FROM P_TT
			WHERE PROJECTION_ID=5))


UPDATE PROJECTIONS 
SET PROJECTION_TYPE=13 
WHERE PROJECTION_ID=2
UPDATE P_TT 
SET Stop_Date='3/20/1996'
WHERE PROJECTION_ID=2
AND Stop_Date < '9999-12-31'
AND Stop_Date > '3/20/1996'
UPDATE P_TT 
SET Start_Date='3/20/1996'
WHERE PROJECTION_ID=2
AND	(Stop_Date=(	SELECT MAX(Stop_Date) 
			FROM P_TT 
			WHERE PROJECTION_ID=2))


UPDATE PROJECTIONS 
SET PROJECTION_TYPE=11 
WHERE PROJECTION_ID=3
UPDATE P_TT 
SET Stop_Date='5/28/1996'
WHERE PROJECTION_ID=3 
AND Stop_Date < '9999-12-31'
AND Stop_Date > '5/28/1996'
UPDATE P_TT 
SET Start_Date='5/28/1996'
WHERE PROJECTION_ID=3 
AND	(Stop_Date=(	SELECT MAX(Stop_Date) 
			FROM P_TT 
			WHERE PROJECTION_ID=3))


UPDATE PROJECTIONS 
SET PROJECTION_TYPE=14 
WHERE PROJECTION_ID=2
UPDATE P_TT 
SET Stop_Date= '6/14/1996'
WHERE PROJECTION_ID=2 
AND Stop_Date < '9999-12-31'
AND Stop_Date > '6/14/1996'
UPDATE P_TT 
SET Start_Date= '6/14/1996'
WHERE PROJECTION_ID=2 
AND	(Stop_Date=(	SELECT MAX(Stop_Date) 
			FROM P_TT 
			WHERE PROJECTION_ID=2))


DELETE FROM PROJECTIONS 
WHERE PROJECTION_ID=4 
UPDATE P_TT 
SET Stop_Date='07/12/1996'
WHERE PROJECTION_ID=4 
AND
	(Stop_Date=(	SELECT MAX(Stop_Date) 
			FROM P_TT 
			WHERE PROJECTION_ID=4))

