Snowflake SnowPro Core COF-C03 Practice Test Questions and Exam Dumps Part15 Q281-300

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

 

Question 281

Which Snowflake table constraint is used to identify a column or combination of columns intended to uniquely identify rows?

  1. FOREIGN KEY
  2. CHECK
  3. UNIQUE
  4. PRIMARY KEY

Correct Answer: 4

Explanation

A PRIMARY KEY constraint identifies a column or combination of columns intended to uniquely identify rows in a table. It communicates an important data-modeling rule and can help document relationships and expected data quality. In Snowflake, constraints have specific enforcement behavior that differs from some traditional relational database systems, so defining a constraint does not necessarily mean Snowflake will automatically prevent every violating data modification. UNIQUE constraints also describe uniqueness, while FOREIGN KEY describes relationships between tables and CHECK expresses a condition that values are expected to satisfy.

Question 282

Which constraint expresses a relationship between a column in one table and a key in another table?

  1. FOREIGN KEY
  2. CHECK
  3. UNIQUE
  4. NOT NULL

Correct Answer: 1

Explanation

A FOREIGN KEY constraint describes a relationship between columns in related tables. It indicates that values in the referencing column are intended to correspond to values represented by a key in another table. This is useful for documenting relationships such as orders associated with customers or transactions associated with accounts. UNIQUE and PRIMARY KEY constraints address uniqueness, while CHECK describes a logical condition on values. Snowflake supports these constraint concepts, but users should understand Snowflake’s specific enforcement semantics when designing applications that depend on constraints to prevent invalid data.

Question 283

Which constraint is used to require that a column contain a value rather than NULL?

  1. UNIQUE
  2. NOT NULL
  3. FOREIGN KEY
  4. PRIMARY KEY

Correct Answer: 2

Explanation

A NOT NULL constraint specifies that a column should not contain NULL values. It is useful when a particular attribute is required for every row, such as an identifier, required business date, or mandatory status value. NOT NULL differs from UNIQUE because uniqueness concerns whether values are repeated, while NOT NULL concerns whether a value is missing. A PRIMARY KEY also has non-null and uniqueness characteristics, but NOT NULL can be applied independently to required columns that are not necessarily identifiers. This constraint supports clear table-level data-quality requirements.

Question 284

Which constraint is intended to require values in a column to be unique?

  1. CHECK
  2. FOREIGN KEY
  3. UNIQUE
  4. DEFAULT

Correct Answer: 3

Explanation

A UNIQUE constraint expresses the requirement that values in the constrained column or column combination should be unique. It is commonly used for attributes such as business identifiers or reference values where duplicate values are not expected. UNIQUE differs from PRIMARY KEY because a table can have multiple unique constraints, while a table has a single primary key definition. FOREIGN KEY describes relationships between tables, CHECK expresses a logical condition, and DEFAULT supplies a value when one is not explicitly provided. Snowflake’s constraint enforcement behavior should be considered when relying on these definitions.

Question 285

Which table definition feature can provide a value automatically when an INSERT statement omits a column?

  1. DEFAULT
  2. UNIQUE
  3. FOREIGN KEY
  4. CHECK

Correct Answer: 1

Explanation

A DEFAULT value specifies what Snowflake should use for a column when an INSERT statement does not provide a value for that column. Defaults can simplify data-loading workflows by supplying standard values for appropriate columns. For example, a status column can have a predefined initial value when a new record is created. DEFAULT does not enforce uniqueness or relationships and does not validate arbitrary logical conditions. UNIQUE and FOREIGN KEY describe constraints, while CHECK expresses an expected condition. DEFAULT is therefore useful for automatic value assignment during row insertion.

Question 286

Which Snowflake object is designed to encapsulate reusable SQL or procedural logic that can be invoked by users or applications?

  1. Stream
  2. Stored procedure
  3. Stage
  4. Resource monitor

Correct Answer: 2

Explanation

A stored procedure encapsulates reusable logic that can be invoked when needed. Depending on its implementation, it can contain SQL and procedural operations used to automate business logic, administrative workflows, or data-processing activities. Stored procedures are different from functions because procedures are generally invoked as actions and can perform procedural operations, while functions are designed to return a value. Streams track data changes, stages provide locations for data files, and Resource Monitors manage credit-related thresholds. Stored procedures are therefore useful when reusable operational logic needs to be centralized.

Question 287

What is the primary characteristic of a user-defined function (UDF) in Snowflake?

  1. It automatically creates a warehouse
  2. It returns a value based on its defined logic
  3. It permanently stores query results
  4. It replaces all table privileges

Correct Answer: 2

Explanation

A user-defined function, or UDF, is designed to encapsulate reusable logic and return a value when invoked. A UDF can be useful when the same calculation or transformation needs to be applied repeatedly across queries. Depending on the supported function language and implementation, the logic can be expressed using SQL or supported programming languages. A UDF is not a warehouse-management mechanism and does not permanently store query results. It also does not replace Snowflake’s privilege system. Its primary purpose is reusable value-producing logic.

Question 288

Which statement best distinguishes a stored procedure from a user-defined function?

  1. A procedure is generally invoked to perform operations, while a function returns a value
  2. A function can only be used for storage
  3. A procedure can never contain SQL
  4. A function automatically creates database objects

Correct Answer: 1

Explanation

A stored procedure is generally designed to perform operations or execute procedural workflows, while a user-defined function is designed to return a value that can be used within supported SQL expressions or statements. Both can encapsulate reusable logic, but their invocation and intended roles differ. Procedures are useful for operational workflows and multi-step processing, while functions are useful for reusable calculations or transformations. Neither automatically creates warehouses or replaces access controls. Understanding this distinction helps developers select the appropriate programmable object for a specific Snowflake workload.

Question 289

Which Snowflake function can construct an OBJECT from specified key-value pairs?

  1. ARRAY_SIZE
  2. OBJECT_CONSTRUCT
  3. SPLIT
  4. GET_PATH

Correct Answer: 2

Explanation

OBJECT_CONSTRUCT creates a semi-structured OBJECT from specified key-value pairs. It is useful when SQL transformations need to produce JSON-like objects dynamically from relational columns or expressions. The resulting object can be stored in a VARIANT column or processed by other semi-structured functions. ARRAY_SIZE measures the number of elements in an array, SPLIT converts delimited text into an array, and GET_PATH retrieves values from an existing semi-structured structure. OBJECT_CONSTRUCT therefore focuses on creating key-value structures rather than extracting or measuring existing semi-structured data.

Question 290

Which Snowflake function can retrieve a value from a semi-structured object using a specified path?

  1. GET_PATH
  2. OBJECT_CONSTRUCT
  3. ARRAY_SIZE
  4. COUNT

Correct Answer: 1

Explanation

GET_PATH retrieves a value from a semi-structured VARIANT structure using a specified path. It is useful when JSON or other nested data contains values that need to be accessed without manually navigating each level of the structure. The function can help extract nested attributes from objects and arrays according to the supplied path expression. OBJECT_CONSTRUCT performs the opposite conceptual task by creating an object from key-value pairs. ARRAY_SIZE determines array length, while COUNT performs aggregation. GET_PATH is therefore appropriate when the requirement is targeted extraction from nested semi-structured data.

Question 291

Which Snowflake data type can represent an arbitrary-precision fixed-point number with a defined scale?

  1. FLOAT
  2. BOOLEAN
  3. NUMBER
  4. BINARY

Correct Answer: 3

Explanation

NUMBER is Snowflake’s fixed-point numeric data type and can represent numbers with defined precision and scale. It is commonly used for values such as monetary amounts, quantities, and other measurements where predictable decimal precision is important. FLOAT is an approximate floating-point numeric type and is more appropriate when a floating-point representation is acceptable. BOOLEAN represents logical true or false values, while BINARY stores binary data. Choosing NUMBER can therefore be appropriate when calculations require controlled decimal precision rather than approximate floating-point behavior.

Question 292

Which Snowflake data type is intended for approximate floating-point numeric values?

  1. FLOAT
  2. NUMBER
  3. DATE
  4. VARCHAR

Correct Answer: 1

Explanation

FLOAT is used for approximate floating-point numeric values. It is appropriate for workloads where floating-point representation is suitable and exact fixed-point decimal precision is not the primary requirement. NUMBER provides fixed-point numeric representation and is generally more appropriate when controlled precision and scale are important, such as many financial calculations. DATE stores calendar dates, while VARCHAR stores character strings. The distinction between approximate and fixed-point numeric types is important because the choice can influence precision, storage representation, and the interpretation of calculated results.

Question 293

Which Snowflake data type is used to store variable-length character strings?

  1. BINARY
  2. VARCHAR
  3. BOOLEAN
  4. DATE

Correct Answer: 2

Explanation

VARCHAR stores character string data and is commonly used for names, descriptions, identifiers, codes, and other textual values. Snowflake supports VARCHAR for variable-length character data and allows users to specify length constraints when appropriate, although the platform’s storage behavior differs from some traditional databases. BINARY is intended for binary values, BOOLEAN stores true or false values, and DATE represents calendar dates. Selecting VARCHAR is appropriate when the information consists primarily of text rather than numeric, temporal, logical, or binary data.

Question 294

Which Snowflake data type is designed to store binary data rather than character text?

  1. VARCHAR
  2. VARIANT
  3. BINARY
  4. BOOLEAN

Correct Answer: 3

Explanation

BINARY is the Snowflake data type intended for binary data. It can represent byte-oriented information rather than ordinary character strings. This makes it appropriate for certain encoded, encrypted, or otherwise binary representations that should not be treated as text. VARCHAR is used for character strings, VARIANT is used for semi-structured values, and BOOLEAN represents logical values. Choosing the correct data type helps ensure that Snowflake interprets stored information appropriately and that subsequent SQL functions operate against the intended representation.

Question 295

Which Snowflake data type can hold semi-structured values such as JSON, XML-like structures, arrays, and objects?

  1. DATE
  2. VARIANT
  3. NUMBER
  4. BINARY

Correct Answer: 2

Explanation

VARIANT is Snowflake’s flexible data type for storing semi-structured values. It can contain JSON-like objects, arrays, strings, numbers, Boolean values, and other supported structured representations. This allows organizations to ingest semi-structured data without first converting every nested element into separate relational columns. Functions and path expressions can then be used to inspect and transform the stored content. DATE, NUMBER, and BINARY are specialized data types for temporal, numeric, and binary information. VARIANT is therefore particularly useful when the structure of incoming data is nested or variable.

Question 296

Which COPY INTO option determines how Snowflake handles errors encountered while loading files?

  1. ON_ERROR
  2. PURGE
  3. PATTERN
  4. FILES

Correct Answer: 1

Explanation

ON_ERROR specifies how COPY INTO should handle errors encountered while loading data. Depending on the selected option, Snowflake can stop the load, continue under defined conditions, or apply other supported error-handling behavior. This option is important when ingestion pipelines need predictable behavior for malformed records or files. PURGE controls whether successfully loaded staged files are removed, PATTERN selects files using a regular expression, and FILES identifies particular files. ON_ERROR therefore directly addresses error-handling behavior during data loading rather than file selection or cleanup.

Question 297

Which COPY INTO option can skip a specified number of initial rows in supported input files?

  1. FORCE
  2. MATCH_BY_COLUMN_NAME
  3. SKIP_HEADER
  4. PURGE

Correct Answer: 3

Explanation

SKIP_HEADER specifies how many initial rows should be skipped when loading supported file formats. It is commonly useful for delimited files that contain one or more header rows before the actual data records. For example, a CSV file with a column-name row can be loaded while excluding that header from the table data. FORCE controls whether previously loaded files may be reloaded, MATCH_BY_COLUMN_NAME controls name-based column matching, and PURGE can remove successfully loaded staged files. SKIP_HEADER therefore addresses unwanted leading rows in source files.

Question 298

Which Snowflake object stores the definition of how staged files should be interpreted during loading?

  1. File format
  2. Resource monitor
  3. Role
  4. Warehouse

Correct Answer: 1

Explanation

A file format object stores settings that describe how Snowflake should interpret files during loading or unloading. Depending on the format, these settings can include delimiters, compression, header handling, escaping, and other parsing characteristics. Reusable file format objects can simplify data-ingestion configurations because the same interpretation rules can be referenced by multiple operations. A warehouse supplies compute resources, a role manages privileges, and a Resource Monitor manages credit-consumption thresholds. File formats therefore focus on the structure and interpretation of staged data files.

Question 299

Which Snowflake capability allows data to be loaded continuously from files as they become available in a stage?

  1. Secure Data Sharing
  2. Snowpipe
  3. Materialized view
  4. Search Optimization Service

Correct Answer: 2

Explanation

Snowpipe is designed for continuous or near-continuous loading of data from files as they become available in a stage. It automates file ingestion so that applications do not need to repeatedly issue traditional batch COPY commands for every newly arrived file. Snowpipe is particularly useful for event-driven ingestion pipelines where data arrives throughout the day. Secure Data Sharing provides controlled data access, materialized views maintain query results for supported workloads, and Search Optimization improves certain selective query patterns. Snowpipe therefore addresses continuous file-based ingestion.

Question 300

Which Snowflake capability allows applications to send rows directly into Snowflake without first placing traditional files in a stage?

  1. Snowpipe Streaming
  2. Secure Data Sharing
  3. External Table
  4. File Format

Correct Answer: 1

Explanation

Snowpipe Streaming enables applications to ingest data directly into Snowflake tables without requiring the traditional file-staging approach used by file-based pipelines. It is designed for low-latency streaming ingestion scenarios where records become available continuously and applications need them available in Snowflake quickly. This differs from Snowpipe, which is focused on automated ingestion of files that arrive in stages. External tables provide access to data stored externally, while file formats define how staged files are interpreted. Snowpipe Streaming therefore addresses direct row-oriented streaming ingestion use cases.