帶您了解DB2表管理語句
數(shù)據(jù)庫的表管理是數(shù)據(jù)庫系統(tǒng)中非常重要的部分,下面就帶您了解一些DB2表管理的語句寫法,供您參考學(xué)習(xí),希望對(duì)您學(xué)習(xí)DB2表管理有所幫助。
創(chuàng)建表
CREATE TABLE BOOKS
( BOOKID INTEGER,
BOOKNAME VARCHAR(100),
ISBN CHAR(10) )
使用like創(chuàng)建表
CREATE TABLE MYBOOKS LIKE BOOKS
制定表空間
db2 create table T1 (c1 int ...) in TS1
db2 create table T2 (c1 float ...) in TS1
刪除表
drop table tab_name
添加刪除列
db2 => create table test (c1 int)
DB20000I The SQL command completed successfully.
db2 => alter table test add c2 char(8)
DB20000I The SQL command completed successfully.
db2 => alter table test drop c2
DB20000I The SQL command completed successfully.
以上就是DB2表管理語句的介紹。
【編輯推薦】