Which command should be used to assign a key to a Snowflake user who needs to connect using key pair authentication?
Answer : D
Which Snowflake object can be used to record DML changes made to a table?
Answer : C
Snowflake Streams are used to track and record Data Manipulation Language (DML) changes made to a table. Streams capture changes such as inserts, updates, and deletes, which can then be processed by other Snowflake objects or external applications.
Creating a Stream:
CREATE OR REPLACE STREAM my_stream ON TABLE my_table;
Using Streams: Streams provide a way to process changes incrementally, making it easier to build efficient data pipelines.
Consuming Stream Data: The captured changes can be consumed using SQL queries or Snowflake tasks.
References:
Snowflake Documentation: Using Streams
Snowflake Documentation: Change Data Capture (CDC) with Streams
What Snowflake objects can contain custom application logic written in JavaScript? (Select TWO)
Answer : A, E
Snowflake allows users to write custom application logic in JavaScript for two types of objects: Stored Procedures and User-Defined Functions (UDFs).
Stored Procedures: Snowflake stored procedures can be written in JavaScript to encapsulate complex business logic and procedural operations.
CREATE OR REPLACE PROCEDURE my_procedure()
RETURNS STRING
LANGUAGE JAVASCRIPT
EXECUTE AS CALLER
AS
$$
// JavaScript logic here
$$;
User-Defined Functions (UDFs): Snowflake UDFs can be written in JavaScript to perform custom calculations or operations on data.
CREATE OR REPLACE FUNCTION my_function(x FLOAT)
RETURNS FLOAT
LANGUAGE JAVASCRIPT
AS
$$
return x * 2;
$$;
References:
Snowflake Documentation: Stored Procedures
Snowflake Documentation: User-Defined Functions (UDFs)
Which service or tool is a Command Line Interface (CLI) client used for connecting to Snowflake to execute SQL queries?
Answer : D
SnowSQL is the Command Line Interface (CLI) client provided by Snowflake for executing SQL queries and performing various tasks. It allows users to connect to their Snowflake accounts and interact with the Snowflake data warehouse.
Installation: SnowSQL can be downloaded and installed on various operating systems.
Configuration: Users need to configure SnowSQL with their Snowflake account credentials.
Usage: Once configured, users can run SQL queries, manage data, and perform administrative tasks through the CLI.
References:
Snowflake Documentation: SnowSQL
Snowflake Documentation: Installing SnowSQL
What takes the highest precedence in Snowflake file format options, when specified in multiple locations during data loading?
Answer : C
When loading data into Snowflake, the file format options specified in the COPY INTO <table> statement take the highest precedence over other locations such as the stage or table definitions. This ensures that any specific settings for a particular load operation are applied correctly.
File Format Hierarchy:
Stage Definition: Specifies default file format options for files staged in the location.
Table Definition: Can specify default file format options associated with the table.
COPY INTO Statement: Overrides both the stage and table definitions with the file format options specified directly in the statement.
Example Usage:
COPY INTO my_table
FROM @my_stage
FILE_FORMAT = (FORMAT_NAME = 'my_format' FIELD_OPTIONALLY_ENCLOSED_BY = ''');
References:
Snowflake Documentation: Copy into Table
Snowflake Documentation: File Format Options
Why would a Snowflake user load JSON data into a VARIANT column instead of a string column?
Answer : C
A VARIANT column in Snowflake is specifically designed to store semi-structured data, such as JSON, and allows for the creation of a data hierarchy. Unlike string columns, VARIANT columns can natively handle JSON data structures, enabling complex querying and manipulation of hierarchical data using functions designed for semi-structured data.
References:
Snowflake Documentation: VARIANT Data
Which Snowflake native tool can be used to diagnose and troubleshoot network connections?
Answer : A
SnowSQL, Snowflake's command-line client, can be used to diagnose and troubleshoot network connections. SnowSQL provides various commands and options to test connectivity, configure network settings, and troubleshoot issues related to network connections between the client and Snowflake.
References:
Snowflake Documentation: SnowSQL