DB2 table management statements

Source: Internet
Author: User
Tags db2 create table

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.