about Teradata SQL,
[url]http://www.razorsql.com/docs/teradata_alter_table.html[/url]Rename table:
rename table Samples.p to Samples.ccqa08_pAdd Column:
ALTER TABLE Samples.address ADD NewCol CHAR(25)
ALTER TABLE Samples.address ADD NewCol CHAR(25) DEFAULT '22' NOT NULLAdd 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.addressDrop Table:
DROP TABLE retail.employeeDrop View:
DROP VIEW retail.employee_viewDrop Column:
ALTER TABLE Samples.address DROP COLUMN cachekeyDrop Constraint:
ALTER TABLE Samples.address DROP CONSTRAINT address_idCreate View:
CREATE VIEW retail.test_view AS select id from customerCreate 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]
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。