Snowflake SnowPro Core COF-C03 Practice Test Questions and Exam Dumps Part18 Q341-360

View Full Snowflake SnowPro Core COF-C03 Exam Dumps and Practice Test Dumps.

 

Question 341

Which Snowflake sampling method selects rows based on a random row-level process?

  1. SYSTEM
  2. BERNOULLI
  3. BLOCK
  4. PARTITION

Correct Answer: 2

Explanation

BERNOULLI sampling evaluates each row independently to determine whether it should be included in the sample. The specified sampling percentage represents the approximate probability that an individual row will be selected. Because the selection operates at the row level, the resulting sample can contain rows distributed throughout the table rather than selecting entire storage blocks. SYSTEM sampling uses a different approach based on Snowflake’s underlying data organization. Sampling is useful for exploratory analysis, testing, and working with representative subsets when processing the complete table is unnecessary.

Question 342

Which sampling method operates by selecting data at the micro-partition level rather than independently evaluating every row?

  1. BERNOULLI
  2. ROW
  3. SYSTEM
  4. RANDOM_ROW

Correct Answer: 3

Explanation

SYSTEM sampling selects data at the micro-partition level. Instead of independently evaluating each row, Snowflake determines which micro-partitions participate in the sample. As a result, the actual number of rows returned can vary depending on how data is distributed across micro-partitions. BERNOULLI sampling, in contrast, makes row-level selections. SYSTEM sampling can be useful when users want a random subset while potentially reducing the amount of data that needs to be processed. Understanding the distinction between these methods helps users choose an appropriate sampling approach.

Question 343

What is the primary purpose of the SAMPLE clause in Snowflake SQL?

  1. Encrypting selected rows
  2. Returning a subset of table data
  3. Sorting table records
  4. Compressing micro-partitions

Correct Answer: 2

Explanation

The SAMPLE clause allows users to retrieve a subset of rows from a table rather than processing the complete dataset. This can be useful for exploratory analysis, development, testing, and quick inspection of large datasets. Snowflake supports different sampling approaches, including BERNOULLI and SYSTEM, which determine how rows or micro-partitions are selected. SAMPLE does not encrypt data, sort the complete table, or directly perform micro-partition compression. Its purpose is to reduce the amount of data returned or processed for a particular query.

Question 344

Which Snowflake function is useful for estimating the number of distinct values without necessarily calculating an exact count?

  1. APPROX_COUNT_DISTINCT
  2. COUNT_ALL_EXACT
  3. DISTINCT_ESTIMATE_TABLE
  4. APPROX_SUM_ROWS

Correct Answer: 1

Explanation

APPROX_COUNT_DISTINCT provides an approximate count of distinct values. Approximate algorithms can be useful when analytical workloads involve very large datasets and an estimate is sufficient for the business requirement. An approximate calculation can reduce computational requirements compared with an exact distinct count in some situations. The function is therefore useful for large-scale exploratory analysis, cardinality estimation, and analytical reporting where a small estimation error is acceptable. The other options are not standard Snowflake functions for approximate distinct counting.

Question 345

Which function can calculate an approximate percentile for a numeric expression?

  1. MEDIAN_EXACT
  2. APPROX_PERCENTILE
  3. PERCENTAGE_ESTIMATE
  4. APPROX_MEDIAN_COUNT

Correct Answer: 2

Explanation

APPROX_PERCENTILE calculates an approximate percentile for an expression. Percentiles are useful for understanding the distribution of numerical values, such as transaction amounts, response times, or customer activity. Approximate percentile functions can be valuable for large analytical workloads where exact calculations may require more processing and the use case can tolerate an approximate result. The function works with a specified percentile value and returns an estimate based on the available data. The other listed names are not standard Snowflake functions for approximate percentile calculations.

Question 346

Which Snowflake object generates sequential numeric values that can be used when inserting rows?

  1. Sequence
  2. Stage
  3. Stream
  4. Share

Correct Answer: 1

Explanation

A Snowflake sequence is a database object that generates sequential numeric values. Sequences can be used when applications or data-loading processes require generated numeric identifiers or other incrementing values. Unlike a stage, which identifies a file-storage location, a stream tracks table changes, and a share exposes selected data to another account. A sequence provides a reusable mechanism for generating numeric values according to its configuration. It can therefore be useful in workflows where unique or sequential identifiers need to be generated independently of manually supplied values.

Question 347

Which column definition can automatically generate numeric values for newly inserted rows?

  1. GENERATED ALWAYS AS IDENTITY
  2. GENERATED AS SEQUENCE TEXT
  3. AUTO_NUMBER VARCHAR
  4. DEFAULT AUTO STRING

Correct Answer: 1

Explanation

GENERATED ALWAYS AS IDENTITY defines an identity column whose values are generated automatically when rows are inserted. This is useful when a table requires system-generated numeric identifiers instead of requiring users or applications to supply every identifier manually. Identity columns are especially useful for surrogate keys and other internally generated numeric values. The generated values are handled by Snowflake according to the identity-column definition. The other options do not represent standard Snowflake syntax for automatically generating numeric identity values.

Question 348

What is a key characteristic of an identity column in Snowflake?

  1. It requires JSON input
  2. It automatically generates numeric values
  3. It stores only timestamps
  4. It prevents all duplicate rows

Correct Answer: 2

Explanation

An identity column automatically generates numeric values for inserted rows according to its definition. This removes the need for applications or users to manually provide values for that column in typical insert operations. Identity columns are commonly useful for surrogate identifiers and internally generated keys. They do not inherently store timestamps, require JSON input, or guarantee that every row in the table is unique across all columns. Their primary purpose is automated numeric value generation. Other constraints may still be needed when specific uniqueness requirements must be enforced.

Question 349

Which SQL construct allows a table function to be evaluated using values from preceding tables in the FROM clause?

  1. LATERAL
  2. GLOBAL
  3. PARALLEL
  4. CORRELATED_TABLE

Correct Answer: 1

Explanation

The LATERAL construct allows a table function or subquery in the FROM clause to reference columns from preceding items in that same FROM clause. This enables row-dependent processing where the function’s input can change according to values from an earlier table expression. LATERAL is particularly useful when working with table functions that need access to data from each input row. It provides a way to correlate table expressions while preserving SQL’s relational query structure. The other listed constructs are not standard Snowflake syntax for this behavior.

Question 350

Which Snowflake function is commonly used with LATERAL to expand elements from an ARRAY or OBJECT into rows?

  1. OBJECT_BUILD
  2. FLATTEN
  3. ARRAY_ROWS
  4. EXPAND_OBJECT

Correct Answer: 2

Explanation

FLATTEN is a table function that converts elements of semi-structured data into rows. It can process values such as arrays and objects stored in VARIANT data. When combined with LATERAL, FLATTEN can be applied to values from each row of a source table, allowing nested data to be expanded dynamically. This pattern is useful for querying JSON-like structures and transforming nested information into a relational form. The other listed names are not standard Snowflake functions for expanding arrays or objects into rows.

Question 351

Which Snowflake statement is used to transfer ownership of an object to another role?

  1. MOVE OWNERSHIP
  2. ALTER OWNERSHIP
  3. GRANT OWNERSHIP
  4. TRANSFER ROLE

Correct Answer: 3

Explanation

GRANT OWNERSHIP is used to transfer ownership of a Snowflake object to another role. Ownership is an important authorization concept because the owning role has significant control over the object and its associated privileges. Transferring ownership should therefore be performed carefully, particularly in environments that use role-based administrative responsibilities. GRANT OWNERSHIP differs from granting ordinary privileges such as SELECT or USAGE because ownership represents control of the object itself. The other listed statements are not standard Snowflake syntax for transferring object ownership.

Question 352

Which command removes a previously granted privilege from a role?

  1. DELETE PRIVILEGE
  2. REVOKE
  3. REMOVE GRANT
  4. DROP ACCESS

Correct Answer: 2

Explanation

REVOKE removes a previously granted privilege from a role or other authorized principal. For example, an administrator can revoke SELECT access when a role should no longer be permitted to query a table. Revocation is an important part of maintaining access controls because permissions can change as responsibilities evolve. REVOKE is different from DROP because dropping an object removes the object itself rather than simply changing authorization. Proper privilege management commonly involves both granting required access and revoking access that is no longer appropriate.

Question 353

Which Snowflake feature can automatically grant a privilege on newly created objects of a specified type within a schema?

  1. Future grants
  2. Current grants
  3. Automatic ownership
  4. Object inheritance only

Correct Answer: 1

Explanation

Future grants allow administrators to specify privileges that should automatically be granted on objects created later. For example, a role can be configured to receive SELECT privileges on future tables within a schema. This reduces the need to manually grant the same privilege every time a new object is created. Future grants are especially useful in environments with recurring object creation and standardized access requirements. They differ from ordinary grants, which apply to objects that already exist. Future grants therefore support more consistent ongoing privilege administration.

Question 354

Which schema type centralizes privilege management so that object owners cannot independently grant access on objects within the schema?

  1. Temporary schema
  2. Managed access schema
  3. External schema
  4. Shared schema

Correct Answer: 2

Explanation

A managed access schema centralizes privilege management with the schema owner or a role with the appropriate authority. Object owners inside the schema do not independently control grants in the same way they can in a standard schema. This design helps organizations apply consistent access policies across collections of tables, views, and other objects. Managed access schemas are particularly useful when security administration needs to be separated from individual object ownership. Temporary, external, and shared schema descriptions do not provide this specific centralized privilege-management model.

Question 355

Which privilege is generally required to create objects inside a Snowflake schema?

  1. CREATE privilege on the schema
  2. INSERT privilege on the database
  3. SELECT privilege on the warehouse
  4. MODIFY privilege on the account

Correct Answer: 1

Explanation

Creating objects within a Snowflake schema generally requires the appropriate CREATE privilege on that schema, along with the necessary access to the containing database and other relevant resources. The specific CREATE privilege depends on the type of object being created. INSERT is related to adding data rather than creating schema objects, SELECT controls data querying, and warehouse privileges concern compute usage. Understanding object-level privileges is important because Snowflake authorization is based on permissions granted to roles. Creation therefore requires an appropriate creation privilege rather than a data-query privilege.

Question 356

Which Snowflake role is primarily associated with managing users and roles rather than administering all account-level capabilities?

  1. USERADMIN
  2. PUBLIC
  3. SYSADMIN
  4. SECURITYADMIN

Correct Answer: 1

Explanation

USERADMIN is intended primarily for managing users and roles. It supports administrative activities related to creating and managing these security principals without representing the broadest account-level administrative authority. SECURITYADMIN is more broadly associated with security privileges and grant management, while SYSADMIN focuses on managing databases, schemas, warehouses, and other objects used by the organization. PUBLIC is a role available to users but is not a dedicated administrative role. Separating responsibilities among roles supports controlled administration and reduces unnecessary concentration of privileges.

Question 357

Which command can allow a user to activate secondary roles for privilege evaluation during a session?

  1. USE SECONDARY ROLES
  2. SET SECONDARY ACCESS
  3. ENABLE ROLE CHAIN
  4. ACTIVATE ALL GRANTS

Correct Answer: 1

Explanation

USE SECONDARY ROLES controls whether secondary roles are active for privilege evaluation during a session. Snowflake role-based access can involve a primary role together with secondary roles, allowing privileges from multiple roles to participate when secondary roles are enabled. This can be useful when users need access provided by more than one assigned role without repeatedly changing their primary role. The command provides explicit session-level control over secondary-role activation. The other listed statements are not standard Snowflake commands for enabling secondary roles.

Question 358

Which Snowflake object can be used to package reusable procedural logic that may contain multiple SQL statements and control-flow operations?

  1. Stored procedure
  2. Sequence
  3. Stage
  4. Share

Correct Answer: 1

Explanation

A stored procedure packages reusable procedural logic that can include multiple SQL statements and supported control-flow constructs. Procedures are useful for implementing repeatable administrative or data-processing operations that require more than a single SQL expression. They can accept parameters and execute logic according to the procedure definition. A sequence generates numeric values, a stage identifies file-storage locations, and a share provides controlled data access to consumers. Stored procedures therefore provide a reusable programming-oriented mechanism within Snowflake for procedural database operations.

Question 359

Which Snowflake function returns the current session’s active primary role?

  1. CURRENT_USER()
  2. CURRENT_ROLE()
  3. CURRENT_DATABASE()
  4. CURRENT_SCHEMA()

Correct Answer: 2

Explanation

CURRENT_ROLE() returns the role that is currently active as the primary role for the session. This function can be useful when SQL logic, troubleshooting, or auditing needs to determine which primary role is active at execution time. CURRENT_USER() identifies the current user, while CURRENT_DATABASE() and CURRENT_SCHEMA() identify the active database and schema contexts. These functions provide different session-context information. CURRENT_ROLE() is therefore the appropriate function when the requirement is specifically to identify the active primary role.

Question 360

Which Snowflake object is intended to provide a centralized location for reusable named file-format settings?

  1. Sequence
  2. File format
  3. Stream
  4. Resource monitor

Correct Answer: 2

Explanation

A named file format is a Snowflake object that stores reusable file-format settings for operations involving staged files. Instead of repeatedly specifying the same parsing options, users can reference a named file format in applicable data-loading or unloading operations. This promotes consistency and simplifies management when the same file characteristics are used repeatedly. A sequence generates numeric values, a stream tracks table changes, and a Resource Monitor manages credit-related controls. Named file formats therefore provide reusable configuration for interpreting supported files consistently across data workflows.