How do you create a table in DB2?

In this syntax:

  1. First, specify the name of the table that you want to create. The name of the table must be unique within the schema.
  2. Second, specify a list of columns of the table.
  3. Third, specify the table constraint such as PRIMARY KEY , FOREIGN KEY and CHECK constraints.

How do I copy a table in DB2?

Open the Copy Table window: From the Control Center, expand the object tree until you find the Tables folder. Click on the Tables folder. Any existing tables are displayed in the pane on the right side of the window. Right-click the table you want to copy and select Copy from the pop-up menu.

How data is copied from one table to another in DB2?

To copy the data, you need to perform two steps:

  1. Use the FM/Db2 Export Utility (3.7) to export the data to a sequential file (preferably) or a VSAM file. In general, the default mapping is sufficient.
  2. Use the FM/Db2 Import Utility (3.6) to load the exported data into the target Db2 table.

What is a DB2 table?

Tables are logical structures that Db2 maintains. Db2 supports several different types of tables. Tables are made up of columns and rows. The rows of a relational table have no fixed order.

What is clone table in DB2?

Basically, you will create a table with the exact same attributes as a table that already exists at the current server, except that it is empty of data. It is created using the ALTER TABLE SQL statement with the ADD CLONE parameter. This clone table is created in the same table space as the existing table.

How do I insert a table into another table?

The INSERT INTO SELECT statement copies data from one table and inserts it into another table. The INSERT INTO SELECT statement requires that the data types in source and target tables match. Note: The existing records in the target table are unaffected.