- You need to connect to Teradata Database using SQLA or Studio.
- We will now execute the ALTER statement on the DOB column by compressing all values and o_total along with a list of repeating values in these columns.
- ALTER statement will compresses all values in DOB column:
/*Compressing all column values*/ ALTER TABLE td_cookbook.EMP_SAL ADD DOB DATE COMPRESS ; -- ADD COLUMN_NAME DATATYPE
- Next, execute ALTER on the o_total column with a list of repeating values only:
/*Compress list of value*/ ALTER TABLE td_cookbook.EMP_SAL ADD o_total INT COMPRESS (890,90);
- Execute SHOW table to check the ddl of the new table and verify that the desired compression has been added to the table definition. Check the following output: