Example: NORMALIZE - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This CREATE TABLE request defines a table that normalizes on the duration column. Rows are normalized only when values of the columns emp_id, project_name , and dept_id are the same and the Period values for duration meet or overlap.

CREATE TABLE project (
  emp_id	   INTEGER,
  project_name	   VARCHAR(20),
  dept_id	   INTEGER,
  duration	   PERIOD(DATE),
NORMALIZE ON duration);

The following CREATE TABLE request defines a similar project table that also normalizes on the duration column, but specifies dept_id as a column to ignore for normalization. For such a table, a row is normalized only when the values of the columns emp_id and project_name are the same and Period values for duration meet or overlap.

CREATE TABLE project (
  emp_id	   INTEGER,
  project_name	   VARCHAR(20),
  dept_id	   INTEGER,
  duration	   PERIOD(DATE),
NORMALIZE ALL BUT(dept_id) ON duration);