-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.sql
More file actions
28 lines (26 loc) · 967 Bytes
/
setup.sql
File metadata and controls
28 lines (26 loc) · 967 Bytes
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
CREATE OR REPLACE DATABASE STREAMLIT_DEMO;
CREATE OR REPLACE SCHEMA STREAMLIT_DEMO.STREAMLIT_USER_PROFILER;
CREATE OR REPLACE SEQUENCE STREAMLIT_DEMO.STREAMLIT_USER_PROFILER.user_id_seq;
CREATE OR REPLACE TABLE STREAMLIT_DEMO.STREAMLIT_USER_PROFILER.CUSTOMERS(
customer_id INT default user_id_seq.nextval,
years_tenure INT,
average_weekly_workout_count INT,
is_current_customer BOOLEAN,
customer_email VARCHAR
);
INSERT INTO
STREAMLIT_DEMO.STREAMLIT_USER_PROFILER.CUSTOMERS (
years_tenure,
average_weekly_workout_count,
is_current_customer,
customer_email
)
SELECT
abs(random() % 25), -- years_tenure, from 1998
abs(random() % 8), -- weekly workout count, average
--abs(random() % 8), -- is current customer
(random()::bit(32)::int % 3)::bool, -- is current customer
lower(randstr(5, random())) || '@example.org'
FROM
-- table(generator(rowCount => 10000000));
table(generator(rowCount => 10000));