What is the statement for creating a table in DB2?
In DB2, the statement used to create a table is the CREATE TABLE statement. Below is an example:
CREATE TABLE 表名 (
列名1 数据类型,
列名2 数据类型,
...
);
For example, to create a table named “customers” with columns “customer_id” and “customer_name,” you can use the following statement:
CREATE TABLE customers (
customer_id INT,
customer_name VARCHAR(50)
);
In defining a table, you can specify the name of the columns and their data types. Common data types include INT (integer), VARCHAR (variable-length string), DATE (date), and others.