drop database if exists ssb_test;
create database if not exists ssb_test;
use ssb_test;

CREATE TABLE SSB_TEST_CUSTOMER
(
    CUSTKEY    int PRIMARY KEY,
    CUSTOMER   text,
    CITY       text,
    POPULATION int
);

CREATE TABLE SSB_TEST_PART
(
    PARTKEY  int PRIMARY KEY,
    PRODUCT  text,
    CATEGORY text
);

CREATE TABLE SSB_TEST_LINEORDER
(
    CUSTKEY       int references SSB_TEST_CUSTOMER(CUSTKEY),
    PARTKEY       int references SSB_TEST_PART(PARTKEY),
    QUANTITY      float,
    EXTENDEDPRICE float,
    ORDTOTALPRICE float,
    primary key(CUSTKEY, PARTKEY)
);