github.com/dolthub/go-mysql-server@v0.18.0/enginetest/scriptgen/setup/scripts/tpch (about) 1 exec 2 CREATE DATABASE tpch character set utf8mb4; 3 ---- 4 5 exec 6 USE tpch; 7 ---- 8 9 exec 10 CREATE TABLE nation ( N_NATIONKEY INTEGER primary key, 11 N_NAME CHAR(25) NOT NULL, 12 N_REGIONKEY INTEGER NOT NULL, 13 N_COMMENT VARCHAR(152)); 14 ---- 15 16 exec 17 CREATE TABLE region ( R_REGIONKEY INTEGER primary key, 18 R_NAME CHAR(25) NOT NULL, 19 R_COMMENT VARCHAR(152)); 20 ---- 21 22 exec 23 CREATE TABLE part ( P_PARTKEY INTEGER primary key, 24 P_NAME VARCHAR(55) NOT NULL, 25 P_MFGR CHAR(25) NOT NULL, 26 P_BRAND CHAR(10) NOT NULL, 27 P_TYPE VARCHAR(25) NOT NULL, 28 P_SIZE INTEGER NOT NULL, 29 P_CONTAINER CHAR(10) NOT NULL, 30 P_RETAILPRICE DECIMAL(15,2) NOT NULL, 31 P_COMMENT VARCHAR(23) NOT NULL ); 32 ---- 33 34 exec 35 CREATE TABLE supplier ( S_SUPPKEY INTEGER primary key, 36 S_NAME CHAR(25) NOT NULL, 37 S_ADDRESS VARCHAR(40) NOT NULL, 38 S_NATIONKEY INTEGER NOT NULL, 39 S_PHONE CHAR(15) NOT NULL, 40 S_ACCTBAL DECIMAL(15,2) NOT NULL, 41 S_COMMENT VARCHAR(101) NOT NULL); 42 ---- 43 44 exec 45 CREATE TABLE partsupp ( PS_PARTKEY INTEGER NOT NULL, 46 PS_SUPPKEY INTEGER NOT NULL, 47 PS_AVAILQTY INTEGER NOT NULL, 48 PS_SUPPLYCOST DECIMAL(15,2) NOT NULL, 49 PS_COMMENT VARCHAR(199) NOT NULL, primary key (ps_partkey, ps_suppkey) ); 50 ---- 51 52 exec 53 CREATE TABLE customer ( C_CUSTKEY INTEGER primary key, 54 C_NAME VARCHAR(25) NOT NULL, 55 C_ADDRESS VARCHAR(40) NOT NULL, 56 C_NATIONKEY INTEGER NOT NULL, 57 C_PHONE CHAR(15) NOT NULL, 58 C_ACCTBAL DECIMAL(15,2) NOT NULL, 59 C_MKTSEGMENT CHAR(10) NOT NULL, 60 C_COMMENT VARCHAR(117) NOT NULL); 61 ---- 62 63 exec 64 CREATE TABLE orders ( O_ORDERKEY INTEGER primary key, 65 O_CUSTKEY INTEGER NOT NULL, 66 O_ORDERSTATUS CHAR(1) NOT NULL, 67 O_TOTALPRICE DECIMAL(15,2) NOT NULL, 68 O_ORDERDATE DATE NOT NULL, 69 O_ORDERPRIORITY CHAR(15) NOT NULL, 70 O_CLERK CHAR(15) NOT NULL, 71 O_SHIPPRIORITY INTEGER NOT NULL, 72 O_COMMENT VARCHAR(79) NOT NULL); 73 ---- 74 75 exec 76 CREATE TABLE lineitem ( L_ORDERKEY INTEGER NOT NULL, 77 L_PARTKEY INTEGER NOT NULL, 78 L_SUPPKEY INTEGER NOT NULL, 79 L_LINENUMBER INTEGER NOT NULL, 80 L_QUANTITY DECIMAL(15,2) NOT NULL, 81 L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, 82 L_DISCOUNT DECIMAL(15,2) NOT NULL, 83 L_TAX DECIMAL(15,2) NOT NULL, 84 L_RETURNFLAG CHAR(1) NOT NULL, 85 L_LINESTATUS CHAR(1) NOT NULL, 86 L_SHIPDATE DATE NOT NULL, 87 L_COMMITDATE DATE NOT NULL, 88 L_RECEIPTDATE DATE NOT NULL, 89 L_SHIPINSTRUCT CHAR(25) NOT NULL, 90 L_SHIPMODE CHAR(10) NOT NULL, 91 L_COMMENT VARCHAR(44) NOT NULL, 92 primary key(L_ORDERKEY,L_LINENUMBER)); 93 ---- 94 95 exec 96 analyze table customer update histogram on (C_CUSTKEY) using data '{"row_count": 1000}'; 97 ---- 98 99 exec 100 analyze table orders update histogram on (O_ORDERKEY) using data '{"row_count": 1000}'; 101 ---- 102 103 exec 104 analyze table lineitem update histogram on (L_ORDERKEY) using data '{"row_count": 1000}'; 105 ---- 106 107 exec 108 analyze table nation update histogram on (N_NATIONKEY) using data '{"row_count": 1000}'; 109 ---- 110 111 exec 112 analyze table part update histogram on (P_PARTKEY) using data '{"row_count": 1000}'; 113 ---- 114 115 exec 116 analyze table partsupp update histogram on (PS_PARTKEY) using data '{"row_count": 1000}'; 117 ---- 118 119 exec 120 analyze table region update histogram on (R_REGIONKEY) using data '{"row_count": 1000}'; 121 ---- 122 123 exec 124 analyze table supplier update histogram on (S_SUPPKEY) using data '{"row_count": 1000}'; 125 ----