-- First stage of SQL code to record Peter Olsen buying the flat 
-- on 1/15/1998, considering only the valid time dimension
INSERT INTO Prop_Owner
  SELECT 827, property_number, SYSDATE, VT_End
  FROM Prop_Owner
  WHERE property_number = 7797
    AND VT_Begin <= SYSDATE
    AND VT_End > SYSDATE;

UPDATE Prop_Owner
SET VT_End = SYSDATE
WHERE property_number = 7797
  AND VT_Begin < SYSDATE
  AND VT_End > SYSDATE;

UPDATE Prop_Owner
SET customer_number = 827
WHERE property_number = 7797
  AND VT_Begin > SYSDATE;
