add datasets and other usefull files

This commit is contained in:
Oscar Plaisant
2024-06-25 13:24:22 +02:00
parent 8bd048085a
commit fc6a95334d
18 changed files with 245957 additions and 0 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
+98
View File
@@ -0,0 +1,98 @@
-- postgresql import syntax
-- COPY tablename FROM 'filepath' delimiter ';';
-- tinyint type does not exist in postgresql, use smallint instead
-- with postgresql, change char(x) by varchar(x) to avoid having to use fixed size names in Saiku
-- part
CREATE TABLE part (
p_partkey integer not null,
p_name varchar(22) not null,
p_mfgr char(6) not null,
p_category char(7) not null,
p_brand char(9) not null,
p_color varchar(11) not null,
p_type varchar(25) not null,
p_size integer not null,
p_container char(10) not null,
primary key (p_partkey)
);
-- supplier
CREATE TABLE supplier (
s_suppkey integer not null,
s_name char(25) not null,
s_address varchar(25) not null,
s_city char(10),
s_nation char(15),
s_region char(12),
s_phone char(15) not null,
primary key (s_suppkey)
) ;
-- date
CREATE TABLE date (
D_DATEKEY integer not null,
D_DATE char(18) not null,
D_DAYOFWEEK char(9) not null,
D_MONTH char(9) not null,
D_YEAR integer not null,
D_YEARMONTHNUM integer not null,
D_YEARMONTH char(7) not null,
D_DAYNUMINWEEK integer not null,
D_DAYNUMINMONTH integer not null ,
D_DAYNUMINYEAR integer not null ,
D_MONTHNUMINYEAR integer not null ,
D_WEEKNUMINYEAR integer not null,
D_SELLINGSEASON varchar(12) not null,
D_LASTDAYINWEEKFL tinyint not null,
D_LASTDAYINMONTHFL tinyint not null,
D_HOLIDAYFL tinyint not null,
D_WEEKDAYFL tinyint not null,
primary key (D_DATEKEY)
);
-- customer
CREATE TABLE customer (
c_custkey integer not null,
c_name varchar(25) not null,
c_address varchar(25) not null,
c_city char(10),
c_nation char(15),
c_region char(12),
c_phone char(15) not null,
c_mktsegment char(10) not null,
primary key (c_custkey)
);
-- lineorder
CREATE TABLE lineorder (
lo_orderkey integer not null,
lo_linenumber integer not null,
lo_custkey integer not null,
lo_partkey integer not null,
lo_suppkey integer not null,
lo_orderdate integer not null,
lo_orderpriority char(15) not null,
lo_shippriority char(1) not null,
lo_quantity float not null,
lo_extendedprice float not null,
lo_ordtotalprice float not null,
lo_discount float not null,
lo_revenue float not null,
lo_supplycost float not null,
lo_tax float not null,
lo_commitdate integer not null,
l_shipmode char(10) not null,
primary key (lo_orderkey, lo_linenumber),
foreign key (lo_custkey) references customer(c_custkey) ,
foreign key (lo_partkey) references part(p_partkey) ,
foreign key (lo_suppkey) references supplier(s_suppkey) ,
foreign key (lo_orderdate) references date(d_datekey) ,
foreign key (lo_commitdate) references date(d_datekey)
) ;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
Can't render this file because it is too large.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff