How to do it...

  1. Connect to the Teradata database using SQLA or Studio.
  2. Create the following table with the data. We will define a PPI on the column DOB:
/*Partition table*/CREATE volatile TABLE EMP_SAL_PPI
(
id INT,
Sal int,
dob date,
o_total int
) primary index( id)
PARTITION BY RANGE_N (dob BETWEEN DATE '2017-01-01' 
    AND DATE '2017-12-01' EACH INTERVAL '1' DAY)
on commit preserve rows;

INSERT into EMP_SAL_PPI VALUES (1001,2500,'2017-09-01',890);
INSERT into EMP_SAL_PPI VALUES (1002,5500,'2017-09-10',890);
INSERT into EMP_SAL_PPI VALUES (1003,500,'2017-09-02',890);
INSERT into EMP_SAL_PPI VALUES (1004,54500,'2017-09-05',890);
INSERT into EMP_SAL_PPI VALUES (1005,900,'2017-09-23',890);
INSERT into EMP_SAL_PPI VALUES (1006,8900,'2017-08-03' ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.