github.com/matrixorigin/matrixone@v1.2.0/pkg/sql/plan/tpch/ddl.sql (about)

     1  CREATE TABLE NATION  ( N_NATIONKEY  INTEGER NOT NULL,
     2                          N_NAME       VARCHAR(25) /*CHAR(25)*/ NOT NULL,
     3                          N_REGIONKEY  INTEGER NOT NULL,
     4                          N_COMMENT    VARCHAR(152),
     5                          PRIMARY KEY (N_NATIONKEY)
     6                      );
     7  
     8  CREATE TABLE REGION  ( R_REGIONKEY  INTEGER NOT NULL,
     9                          R_NAME       VARCHAR(25) /*CHAR(25)*/ NOT NULL,
    10                          R_COMMENT    VARCHAR(152),
    11                          PRIMARY KEY (R_REGIONKEY)
    12                      );
    13  
    14  CREATE TABLE PART  ( P_PARTKEY     INTEGER NOT NULL,
    15                            P_NAME        VARCHAR(55) NOT NULL,
    16                            P_MFGR        VARCHAR(25) /*CHAR(25)*/ NOT NULL,
    17                            P_BRAND       VARCHAR(10) /*CHAR(10)*/ NOT NULL,
    18                            P_TYPE        VARCHAR(25) NOT NULL,
    19                            P_SIZE        INTEGER NOT NULL,
    20                            P_CONTAINER   VARCHAR(10) /*CHAR(10)*/ NOT NULL,
    21                            P_RETAILPRICE DECIMAL(15,2) NOT NULL,
    22                            P_COMMENT     VARCHAR(23) NOT NULL,
    23                          PRIMARY KEY (P_PARTKEY)
    24                      );
    25  
    26  CREATE TABLE SUPPLIER ( S_SUPPKEY     INTEGER NOT NULL,
    27                               S_NAME        VARCHAR(25) /*CHAR(25)*/ NOT NULL,
    28                               S_ADDRESS     VARCHAR(40) NOT NULL,
    29                               S_NATIONKEY   INTEGER NOT NULL,
    30                               S_PHONE       VARCHAR(15) /*CHAR(15)*/ NOT NULL,
    31                               S_ACCTBAL     DECIMAL(15,2) NOT NULL,
    32                               S_COMMENT     VARCHAR(101) NOT NULL,
    33                          PRIMARY KEY (S_SUPPKEY)
    34                          );
    35  
    36  CREATE TABLE PARTSUPP ( PS_PARTKEY     INTEGER NOT NULL,
    37                               PS_SUPPKEY     INTEGER NOT NULL,
    38                               PS_AVAILQTY    INTEGER NOT NULL,
    39                               PS_SUPPLYCOST  DECIMAL(15,2)  NOT NULL,
    40                               PS_COMMENT     VARCHAR(199) NOT NULL,
    41                           PRIMARY KEY (PS_PARTKEY, PS_SUPPKEY)
    42                          );
    43  
    44  CREATE TABLE CUSTOMER ( C_CUSTKEY     INTEGER NOT NULL,
    45                               C_NAME        VARCHAR(25) NOT NULL,
    46                               C_ADDRESS     VARCHAR(40) NOT NULL,
    47                               C_NATIONKEY   INTEGER NOT NULL,
    48                               C_PHONE       VARCHAR(15) /*CHAR(15)*/ NOT NULL,
    49                               C_ACCTBAL     DECIMAL(15,2)   NOT NULL,
    50                               C_MKTSEGMENT  VARCHAR(10) /*CHAR(10)*/ NOT NULL,
    51                               C_COMMENT     VARCHAR(117) NOT NULL,
    52                          PRIMARY KEY (C_CUSTKEY)
    53                          );
    54  
    55  CREATE TABLE ORDERS  ( O_ORDERKEY       BIGINT NOT NULL,
    56                             O_CUSTKEY        INTEGER NOT NULL,
    57                             O_ORDERSTATUS    VARCHAR(1)/*CHAR(1)*/ NOT NULL,
    58                             O_TOTALPRICE     DECIMAL(15,2) NOT NULL,
    59                             O_ORDERDATE      DATE NOT NULL,
    60                             O_ORDERPRIORITY  VARCHAR(15) /*CHAR(15)*/ NOT NULL,  
    61                             O_CLERK          VARCHAR(15) /*CHAR(15)*/ NOT NULL, 
    62                             O_SHIPPRIORITY   INTEGER NOT NULL,
    63                             O_COMMENT        VARCHAR(79) NOT NULL,
    64                          PRIMARY KEY (O_ORDERKEY)
    65                          );
    66  
    67  CREATE TABLE LINEITEM ( L_ORDERKEY    BIGINT NOT NULL,
    68                               L_PARTKEY     INTEGER NOT NULL,
    69                               L_SUPPKEY     INTEGER NOT NULL,
    70                               L_LINENUMBER  INTEGER NOT NULL,
    71                               L_QUANTITY    INTEGER /*DECIMAL(15,2)*/ NOT NULL,
    72                               L_EXTENDEDPRICE  DECIMAL(15,2) NOT NULL,
    73                               L_DISCOUNT    DECIMAL(15,2) NOT NULL,
    74                               L_TAX         DECIMAL(15,2) NOT NULL,
    75                               L_RETURNFLAG  VARCHAR(1) NOT NULL,
    76                               L_LINESTATUS  VARCHAR(1) NOT NULL,
    77                               L_SHIPDATE    DATE NOT NULL,
    78                               L_COMMITDATE  DATE NOT NULL,
    79                               L_RECEIPTDATE DATE NOT NULL,
    80                               L_SHIPINSTRUCT VARCHAR(25) /*CHAR(25)*/ NOT NULL,
    81                               L_SHIPMODE     VARCHAR(10) /*CHAR(10)*/ NOT NULL,
    82                               L_COMMENT      VARCHAR(44) NOT NULL,
    83                           PRIMARY KEY (L_ORDERKEY, L_LINENUMBER)
    84                          );