[url]http://www.razorsql.com/docs/teradata_alter_table.html[/url]
Rename table:
Add Column:
Add Primary Key:
Add Foreign Key:
Modify Primary Index:
Cleanup Data:
Drop Table:
Drop View:
Drop Column:
Drop Constraint:
Create View:
Create Table:
Note for Create Table:
Column Name
Column Type (for example, Integer, Char, Varchar, etc.)
Length or Precision
Scale (for decimal columns)
Nullability (whether or not the column accepts null)
Primary Key (whether or not the column is a primary key)
Unique (whether to add a unique constraint to the column)
Default Value (the default value that should be inserted when a null is attempted to be inserted into the column)
You can get more docs of teradata database from [url]http://www.teradataforum.com/ncr_pdf.htm[/url]
Rename table:
rename table Samples.p to Samples.ccqa08_p
Add Column:
ALTER TABLE Samples.address ADD NewCol CHAR(25)
ALTER TABLE Samples.address ADD NewCol CHAR(25) DEFAULT '22' NOT NULL
Add Primary Key:
ALTER TABLE RETAIL.EMPLOYEE ADD PRIMARY KEY (EmpNo)
Add Foreign Key:
ALTER TABLE Samples.address
ADD FOREIGN KEY (DeptNo)
REFERENCES address.CLIENT(C_CUSTKEY)
Modify Primary Index:
ALTER TABLE Samples.address MODIFY PRIMARY INDEX (address_id)
Cleanup Data:
Delete from Samples.address
Drop Table:
DROP TABLE retail.employee
Drop View:
DROP VIEW retail.employee_view
Drop Column:
ALTER TABLE Samples.address DROP COLUMN cachekey
Drop Constraint:
ALTER TABLE Samples.address DROP CONSTRAINT address_id
Create View:
CREATE VIEW retail.test_view AS select id from customer
Create Table:
CREATE TABLE retail.test_table
(col1 INTEGER NOT NULL,
col2 CHAR(25),
col3 VARCHAR(25) NOT NULL,
col4 DATE,
PRIMARY KEY (col1))
Note for Create Table:
Column Name
Column Type (for example, Integer, Char, Varchar, etc.)
Length or Precision
Scale (for decimal columns)
Nullability (whether or not the column accepts null)
Primary Key (whether or not the column is a primary key)
Unique (whether to add a unique constraint to the column)
Default Value (the default value that should be inserted when a null is attempted to be inserted into the column)
You can get more docs of teradata database from [url]http://www.teradataforum.com/ncr_pdf.htm[/url]