about Teradata SQL

[url]http://www.razorsql.com/docs/teradata_alter_table.html[/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]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值