You are on page 1of 6

ESS-DWW

Data Warehousing Workshop (Badge 1)

Show course content navigation

Course

Lesson …

✔️ Cod…

▪️

This section is a prerequisite. You must complete this section in order to unlock
additional content.

✔️ Last Check of the Report Before We Send It to DORA


We're going to add "DWW_" the front of each "step" name so that it's easier for our grader

to separate submissions. 
SELECT

'DWW01_3_SCHEMAS_EXIST' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.SCHEMATA where


schema_name in ('FLOWERS','VEGGIES','FRUITS')) as actual

,3 as expected

,'Check if schema exists.' as description

UNION ALL

SELECT

'DWW02_PUBLIC_SCHEMA_DELETED' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.SCHEMATA where


schema_name = 'PUBLIC') as actual

,0 as expected

,'Check if schema was deleted.' as description

UNION ALL

SELECT

'DWW03_ROOT_DEPTH_TABLE_EXISTS' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.TABLES where


table_name = 'ROOT_DEPTH') as actual

,1 as expected

,'Check if table was created.' as description

UNION ALL

SELECT

'DWW04_ROOT_DEPTH_TABLE_EXISTS' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.TABLES where


table_name = 'ROOT_DEPTH') as actual

,1 as expected

,'Check if table was created.' as description

UNION ALL

SELECT

'DWW05_VEG_DETAILS_TABLE_EXISTS' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.TABLES where


table_name = 'VEGETABLE_DETAILS') as actual

,1 as expected

,'Check if table was created.' as description

UNION ALL

SELECT

'DWW06_ROOT_DEPTH_ROW_COUNT' as step

,(select row_count from GARDEN_PLANTS.INFORMATION_SCHEMA.TABLES where


table_name = 'ROOT_DEPTH') as actual

,3 as expected

,'Check number of rows.' as description

UNION ALL

SELECT

'DWW07_VEG_DETAILS_ROW_COUNT' as step

,(select row_count from GARDEN_PLANTS.INFORMATION_SCHEMA.TABLES where


table_name = 'VEGETABLE_DETAILS') as actual

,41 as expected

,'Check number of rows.' as description

UNION ALL
SELECT

'DWW08_COMMA_DBLQUOTE_FF_EXISTS' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.FILE_FORMATS where


FIELD_DELIMITER =',' and FIELD_OPTIONALLY_ENCLOSED_BY ='"') as actual

,1 as expected

,'Check file format with certain config exists.' as description

UNION ALL

SELECT

'DWW09_PIPE_TRIMSPACE_FF_EXISTS' as step

,(select count(*) from GARDEN_PLANTS.INFORMATION_SCHEMA.FILE_FORMATS where


FIELD_DELIMITER ='|' and TRIM_SPACE ='true') as actual

,1 as expected

,'Check file format with certain config exists.' as description

Yes, there are some typos in the test (why are 03 and 04 pretty much the same? we made a
mistake!). Just run the code as it is given to you and we'll sort out the duplication issues we
created when we receive the logs from your account.

Fix YOUR OBJECTS so the test results in 9 rows with matching ACTUAL and EXPECTED
columns. Run the script, edit your objects, run the script edit your objects...Repeat it until

you get matching results. Do not edit the script at all, in any way. 

🎯 Fix Your Issues


If your code checkpoint reveals a problem, Fix it! 

If your table should have 10 rows and it has 11, Fix it!

If your table doesn't seem to exist, because you named it wrong, Fix It!

Don't just accept the results of the Code Checkpoint. Use every Code Checkpoint to find

issues and correct them. 

If something doesn't show up and you feel certain you created it, check the OWNERSHIP.

If you are running the code with your role set to SYSADMIN and the object is owned by
ACCOUNTADMIN, it might appear missing. 

If you need to change the OWNERSHIP to SYSADMIN, follow these directions:

✔️
1/1 point (ungraded)

How important is it for the Actual and Expected columns of your results to match each other?

It's not really important.

It's a little bit important, but not critical.


You cannot get the badge unless these two columns match for every row.


Answer
Correct: ✔️ That's Right! All rows must match if you want to get the badge.

Submit

 Correct (1/1 point)

📣 Hide Discussion
Topic: Meet DORA!
/ Final Check Before DORA

Show all posts by recent activity

 How do I run the grader function in SQL?


1
I tried the following after creating running " USE SCHEMA VEGGIES".
select GARDEN_…

 How do I get the Actual and Expected to match?


1
Hi. I am honestly unsure in regards to how I can make the Actual and Expected values …

 Duplicate checkpoints in the code


2
DWW03 and DWW04 both check for "ROOT_DEPTH" table.
SELECT
'DWW03_ROO…

Add a Post

© All Rights Reserved


Snowflake Education Services includes Instructor-Led Training, SnowPro Certifications, and this online, on-
demand educational courses website. Our on-demand courses are branded as "Snowflake University."
Snowflake University (aka Uni) offers a badge program called Hands-On Essentials as well as other courses.

You might also like