-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathW1_virtual_warehouses.sql
50 lines (36 loc) · 1.28 KB
/
W1_virtual_warehouses.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
---> what menu items does the Freezing Point brand sell?
SELECT
menu_item_name
FROM tasty_bytes_sample_data.raw_pos.menu
WHERE truck_brand_name = 'Freezing Point';
---> what is the profit on Mango Sticky Rice?
SELECT
menu_item_name,
(sale_price_usd - cost_of_goods_usd) AS profit_usd
FROM tasty_bytes_sample_data.raw_pos.menu
WHERE 1=1
AND truck_brand_name = 'Freezing Point'
AND menu_item_name = 'Mango Sticky Rice';
CREATE WAREHOUSE warehouse_dash;
CREATE WAREHOUSE warehouse_gilberto;
SHOW WAREHOUSES;
USE WAREHOUSE warehouse_gilberto;
---> set warehouse size to medium
ALTER WAREHOUSE warehouse_dash SET warehouse_size=MEDIUM;
USE WAREHOUSE warehouse_dash;
SELECT
menu_item_name,
(sale_price_usd - cost_of_goods_usd) AS profit_usd
FROM tasty_bytes_sample_data.raw_pos.menu
ORDER BY 2 DESC;
---> set warehouse size to xsmall
ALTER WAREHOUSE warehouse_dash SET warehouse_size=XSMALL;
---> drop warehouse
DROP WAREHOUSE warehouse_vino;
SHOW WAREHOUSES;
---> create a multi-cluster warehouse (max clusters = 3)
CREATE WAREHOUSE warehouse_vino MAX_CLUSTER_COUNT = 3;
SHOW WAREHOUSES;
---> set the auto_suspend and auto_resume parameters
ALTER WAREHOUSE warehouse_dash SET AUTO_SUSPEND = 180 AUTO_RESUME = FALSE;
SHOW WAREHOUSES;