-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsales_dw_ddl.sql
66 lines (59 loc) · 1.28 KB
/
sales_dw_ddl.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
DROP TABLE IF EXISTS association_rules;
DROP TABLE IF EXISTS product_info;
DROP TABLE IF EXISTS invoice;
DROP TABLE IF EXISTS customer_info;
DROP TABLE IF EXISTS invoice_time;
DROP TABLE IF EXISTS invoice_outliers;
-- Table: Association Rules
CREATE TABLE association_rules (
antecedants Text,
consequents Text,
antecedent_support Float,
consequent_support Float,
support Float,
confidence Float,
lift Float,
leverage Float,
conviction Float
);
-- Table: Product Info
CREATE TABLE product_info (
stock_code Text,
description Text,
unit_price Float
);
-- Table: Invoice
CREATE TABLE invoice (
invoice_no Text,
stock_code Text,
quantity Integer,
invoice_date Text,
customer_id Integer
);
-- Table: Customer Info
CREATE TABLE customer_info (
customer_id Integer,
country Text,
country_code Text
);
-- Table: Invoice Time
CREATE TABLE invoice_time (
invoice_date Text,
dayofweek Integer,
year Integer,
month Text,
day Integer,
hour Integer,
minute Integer,
dayofyear Integer,
weekofyear Integer,
quarter Integer
);
-- Table: Invoice Outliers
CREATE TABLE invoice_outliers (
invoice_no Text,
stock_code Text,
quantity Integer,
invoice_date Text,
customer_id Integer
);