Database table management is a very important part of the database system. The following describes how to write DB2 table management statements for your reference. We hope this will help you learn about DB2 table management.
Create a table
CREATE TABLE BOOKS
(Bookid integer,
Bookname varchar (100 ),
Isbn char (10 ))
Use like to create a table
CREATE TABLE MYBOOKS LIKE BOOKS
Create a tablespace
Db2 create table T1 (c1 int...) in TS1
Db2 create table T2 (c1 float...) in TS1
Delete table
Drop table tab_name
Add and delete Columns
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.
The preceding section describes the DB2 table management statements.
DB2 column modification and restrictions
Five situations in which DB2 deletes duplicate records
Nine common DB2 commands
How to Create a tablespace in DB2 in windows
How to delete tables with large data volumes in DB2