Snowflake Interview Questions and Answers Part 12 |Snowflake |VCKLY Tech| DataCloud| Snowflake DWH

preview_player
Показать описание
In this video, I am going to discuss snowflake interview questions and answers.

Question #1:

create or replace table t1( t1key number, marked varchar(1), isnewstatus varchar(1) );

create or replace table t2( t2key number, marked varchar(1), isnewstatus varchar(1) );

insert into t2 values (1, null,'N');
insert into t2 values (2, null,'N');
insert into t2 values (3, null,'N');

select * from t1;
select * from t2;

merge into t1 using t2 on t1.t1key = t2.t2key

truncate table t2;
insert into t2 values (1, 'D',null);
insert into t2 values (2, NULL,'U');
insert into t2 values (4, null,'N');

merge into t1 using t2 on t1.t1key = t2.t2key

select * from t1;

Question #2 and 3

select object_construct('Key1','Val1', 'Key2');

select object_construct('Key1','Val1', 'Key2', null);

select object_construct('Key1','Val1', 'Key2', 'Val2');

select object_construct('Key1','Val1', 'Key1', 'Val2');

Question #4
-- Before
drop task mytask1;

CREATE TASK mytask1
WAREHOUSE = compute_wh
SCHEDULE = '5 minute'
AS
SELECT 'Task with warehouse compute_wh';

-- After
drop task mytask2;
CREATE TASK mytask2
SCHEDULE = '5 minute'
AS
SELECT 'Serverless task';

Question #5
create or replace file format my_csv_format
type = csv
;
create or replace stage mystage
directory = (enable = true)
file_format = my_csv_format;

drop stream dirtable_mystage_s;

create stream dirtable_mystage_s on stage mystage;

-- upload csv file into above stage from your local system using snowsql utility

alter stage mystage refresh;

select * from dirtable_mystage_s;

⌚Timestamps
00:00 Intro
00:23 Question #1
03:37 Question #2
05:39 Question #3
06:49 Question #4
09:01 Question #5

#snowflake#datacloud#vcklytech
Рекомендации по теме
Комментарии
Автор

1.How to delete duplicate rows from table.
2.how to achieve below query results in snowflake.
Update emp set seq_col=rownum:
Delete from emp where rownum<=2;

praveendeshmukh
visit shbcf.ru