DB2建表语句

db2 => create table test (name char(8) not null primary key,depid smallint,pay bigint)
DB20000I SQL 命令成功完成。

db2 => create table test1 (name char(8) not null primary key,depid smallint references department (depid),pay bigint)
DB20000I SQL 命令成功完成。



db2 => update department set depmanager=‘abc‘ where depid=5



db2 => alter table test alter pay set not null
DB20000I SQL 命令成功完成。


db2 => alter table pay add foreign key (depid) references department (depid)



db2 => reorg table pay



db2 => alter table pay alter pay drop not null


db2 => insert into pay (name,depid) select name,depid from phone

 

DB2建表语句,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。