Not logged in. Login

Assignment 9: TPC-H Create Tables

The Cassandra tables in the tpch* keyspace on our server were created with these statements:

CREATE KEYSPACE tpch1 WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 2 };
USE tpch1;
CREATE TABLE customer (
  custkey int,
  name text,
  address text,
  nationkey int,
  phone text,
  acctbal decimal,
  mktsegment text,
  comment text,
  PRIMARY KEY (custkey)
);
CREATE TABLE nation (
  nationkey int,
  name text,
  regionkey int,
  comment text,
  PRIMARY KEY (nationkey)
);
CREATE TABLE orders (
  orderkey int,
  custkey int,
  orderstatus text,
  totalprice decimal,
  orderdate date,
  order_priority text,
  clerk text,
  ship_priority int,
  comment text,
  PRIMARY KEY (orderkey)
);
CREATE TABLE partsupp (
  partkey int,
  suppkey int,
  availqty int,
  supplycost decimal,
  comment text,
  PRIMARY KEY (partkey, suppkey)
);
CREATE TABLE part (
  partkey int,
  name text,
  mfgr text,
  brand text,
  type text,
  size int,
  container text,
  retailprice decimal,
  comment text,
  PRIMARY KEY (partkey)
);
CREATE TABLE region (
  regionkey int,
  name text,
  comment text,
  PRIMARY KEY (regionkey)
);
CREATE TABLE supplier (
  suppkey int,
  name text,
  address text,
  nationkey int,
  phone text,
  acctbal decimal,
  comment text,
  PRIMARY KEY (suppkey)
);
CREATE TABLE lineitem (
  orderkey int,
  partkey int,
  suppkey int,
  linenumber int,
  quantity int,
  extendedprice decimal,
  discount decimal,
  tax decimal,
  returnflag text,
  linestatus text,
  shipdate date,
  commitdate date,
  receiptdate date,
  shipinstruct text,
  shipmode text,
  comment text,
  PRIMARY KEY (linenumber, orderkey)
);
Updated Fri Aug. 25 2023, 15:55 by ggbaker.