-
Notifications
You must be signed in to change notification settings - Fork 147
/
greenery-dbdiagram.txt
76 lines (66 loc) · 1.38 KB
/
greenery-dbdiagram.txt
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
Table users {
user_id varchar [pk]
first_name varchar
email varchar
phone_number varchar
created_at timestamp
updated_at timestamp
address_id varchar
}
Table addresses {
address_id varchar [pk]
address varchar
zipcode int
state varchar
country varchar
}
Table events {
event_id varchar [pk]
session_id varchar
user_id varchar
event_type varchar
page_url varchar
created_at timestamp
order_id varchar
product_id varchar
}
Table orders {
order_id varchar [pk]
promo_id varchar
user_id varchar
address_id varchar
created_at timestamp
order_cost float
shipping_cost float
order_total float
tracking_id varchar
shipping_service varchar
estimated_delivery_at timestamp
delivered_at timestamp
status varchar
}
Table products {
product_id varchar [pk]
name varchar
price float
inventory int
}
Table order_items {
order_id varchar [pk]
product_id varchar [pk]
quantity int
}
Table promos {
promo_id varchar [pk]
discount int
status varchar
}
Ref: users.address_id > addresses.address_id
Ref: events.user_id > users.user_id
Ref: events.product_id > products.product_id
Ref: events.order_id > orders.order_id
Ref: orders.user_id > users.user_id
Ref: orders.address_id > addresses.address_id
Ref: orders.promo_id > promos.promo_id
Ref: order_items.product_id > products.product_id
Ref: order_items.order_id > orders.order_id