File size: 3,089 Bytes
dd2e46c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
-- Schema: ecommerce__olist
CREATE SCHEMA IF NOT EXISTS "ecommerce__olist";

-- Table: customers
CREATE TABLE "ecommerce__olist"."customers" (
    "customer_id" TEXT,
    "customer_unique_id" TEXT,
    "customer_zip_code_prefix" BIGINT,
    "customer_city" TEXT,
    "customer_state" TEXT
);

-- Table: geolocation
CREATE TABLE "ecommerce__olist"."geolocation" (
    "geolocation_zip_code_prefix" BIGINT,
    "geolocation_lat" DOUBLE PRECISION,
    "geolocation_lng" DOUBLE PRECISION,
    "geolocation_city" TEXT,
    "geolocation_state" TEXT
);

-- Table: leads_closed
CREATE TABLE "ecommerce__olist"."leads_closed" (
    "mql_id" TEXT,
    "seller_id" TEXT,
    "sdr_id" TEXT,
    "sr_id" TEXT,
    "won_date" TEXT,
    "business_segment" TEXT,
    "lead_type" TEXT,
    "lead_behaviour_profile" TEXT,
    "has_company" BIGINT,
    "has_gtin" BIGINT,
    "average_stock" TEXT,
    "business_type" TEXT,
    "declared_product_catalog_size" DOUBLE PRECISION,
    "declared_monthly_revenue" DOUBLE PRECISION
);

-- Table: leads_qualified
CREATE TABLE "ecommerce__olist"."leads_qualified" (
    "mql_id" TEXT,
    "first_contact_date" TEXT,
    "landing_page_id" TEXT,
    "origin" TEXT
);

-- Table: order_items
CREATE TABLE "ecommerce__olist"."order_items" (
    "order_id" TEXT,
    "order_item_id" BIGINT,
    "product_id" TEXT,
    "seller_id" TEXT,
    "shipping_limit_date" TEXT,
    "price" DOUBLE PRECISION,
    "freight_value" DOUBLE PRECISION
);

-- Table: order_payments
CREATE TABLE "ecommerce__olist"."order_payments" (
    "order_id" TEXT,
    "payment_sequential" BIGINT,
    "payment_type" TEXT,
    "payment_installments" BIGINT,
    "payment_value" DOUBLE PRECISION
);

-- Table: order_reviews
CREATE TABLE "ecommerce__olist"."order_reviews" (
    "review_id" TEXT,
    "order_id" TEXT,
    "review_score" BIGINT,
    "review_comment_title" TEXT,
    "review_comment_message" TEXT,
    "review_creation_date" TEXT,
    "review_answer_timestamp" TEXT
);

-- Table: orders
CREATE TABLE "ecommerce__olist"."orders" (
    "order_id" TEXT,
    "customer_id" TEXT,
    "order_status" TEXT,
    "order_purchase_timestamp" TEXT,
    "order_approved_at" TEXT,
    "order_delivered_carrier_date" TEXT,
    "order_delivered_customer_date" TEXT,
    "order_estimated_delivery_date" TEXT
);

-- Table: product_category_name_translation
CREATE TABLE "ecommerce__olist"."product_category_name_translation" (
    "product_category_name" TEXT,
    "product_category_name_english" TEXT
);

-- Table: products
CREATE TABLE "ecommerce__olist"."products" (
    "product_id" TEXT,
    "product_category_name" TEXT,
    "product_name_lenght" DOUBLE PRECISION,
    "product_description_lenght" DOUBLE PRECISION,
    "product_photos_qty" DOUBLE PRECISION,
    "product_weight_g" DOUBLE PRECISION,
    "product_length_cm" DOUBLE PRECISION,
    "product_height_cm" DOUBLE PRECISION,
    "product_width_cm" DOUBLE PRECISION
);

-- Table: sellers
CREATE TABLE "ecommerce__olist"."sellers" (
    "seller_id" TEXT,
    "seller_zip_code_prefix" BIGINT,
    "seller_city" TEXT,
    "seller_state" TEXT
);