Skip to content

Instantly share code, notes, and snippets.

@jster1357
Created June 26, 2025 15:35
Show Gist options
  • Select an option

  • Save jster1357/17797bf6633c99900b9f6fb045a7dc31 to your computer and use it in GitHub Desktop.

Select an option

Save jster1357/17797bf6633c99900b9f6fb045a7dc31 to your computer and use it in GitHub Desktop.
TPCH DDL for BigQuery
CREATE TABLE tpch.supplier
(
s_suppkey INT64,
s_name STRING,
s_address STRING,
s_nationkey INT64,
s_phone STRING,
s_acctbal FLOAT64,
s_comment STRING,
);
CREATE TABLE tpch.partsupp
(
ps_partkey INT64,
ps_suppkey INT64,
ps_availqty INT64,
ps_supplycost FLOAT64,
ps_comment STRING,
);
CREATE TABLE tpch.lineitem
(
l_orderkey INT64 NOT NULL,
l_partkey INT64,
l_suppkey INT64,
l_linenumber INT64 NOT NULL,
l_quantity INT64,
l_extendedprice FLOAT64,
l_discount FLOAT64,
l_tax FLOAT64,
l_returnflag STRING,
l_linestatus STRING,
l_shipdate DATE,
l_commitdate DATE,
l_receiptdate DATE,
l_shipinstruct STRING,
l_shipmode STRING,
l_comment STRING
);
CREATE TABLE tpch.orders
(
o_orderkey INT64,
o_custkey INT64,
o_orderstatus STRING,
o_totalprice FLOAT64,
o_orderdate DATE,
o_orderpriority STRING,
o_clerk STRING,
o_shippriority INT64,
o_comment STRING
);
CREATE TABLE tpch.customer
(
c_custkey INT64,
c_name STRING,
c_address STRING,
c_nationkey INT64,
c_phone STRING,
c_acctbal FLOAT64,
c_mktsegment STRING,
c_comment STRING,
);
CREATE TABLE tpch.part
(
p_partkey INT64,
p_name STRING,
p_mfgr STRING,
p_brand STRING,
p_type STRING,
p_size INT64,
p_container STRING,
p_retailprice FLOAT64,
p_comment STRING,
);
CREATE TABLE tpch.region
(
r_regionkey INT64,
r_name STRING,
r_comment STRING,
);
CREATE TABLE tpch.nation
(
n_nationkey INT64,
n_name STRING,
n_regionkey INT64,
n_comment STRING,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment