This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE SCHEMA abc; | |
USE SCHEMA ABC; | |
CREATE SEQUENCE IF NOT EXISTS EXECUTION_SEQUENCE | |
WITH | |
START WITH = 1 | |
INCREMENT BY = 1 | |
COMMENT = 'DEMO SEQUENCE ' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/68322927/calculating-yoy-revenue-when-not-all-accounts-existed-last-year | |
create or replace table arr_base(account_id varchar, account_name varchar, activity_date date, arr number(32,4)); | |
insert into arr_base (account_id, account_name, activity_date, arr) | |
values | |
('A','ACCOUNT A','2021-01-31',50) | |
,('B','ACCOUNT B','2021-01-31',40) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/68323279/writing-dataframe-to-snowflake-error-binding-data-in-type-timestamp-is-not-su | |
# https://community.snowflake.com/s/question/0D50Z00009UB5aPSAT/how-to-connect-using-sqlalchemy-with-okta-idp | |
import pandas as pd | |
import sqlalchemy as sa | |
from sqlalchemy import * | |
import snowflake.connector | |
# pip install --upgrade snowflake-sqlalchemy pandas | |
# pip install --upgrade snowflake-connector-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warehouse WH_TEST; | |
use database DB_TEST; | |
use schema public; | |
/* | |
create or replace table calendar(calendar_date DATE) | |
insert into calendar(calendar_date) | |
select |