DAA-C01 exam dumps

DAA-C01 practice question 187 of 267

SnowPro® Advanced: Data Analyst. Expert level, Snowflake. Free question with the correct answer and a full explanation.

DAA-C01 Question 187

Single answer3.1 Use SQL extensibility features.

A retail analytics team stores product reviews in a Snowflake table with columns REVIEW_ID, REVIEW_TEXT, and REVIEW_LANGUAGE. Analysts need to run sentiment scoring directly in SQL so the result can be used in downstream views and dashboards. The team wants to minimize operational overhead, avoid moving data out of Snowflake, and ensure the logic can be invoked as part of standard SQL queries. Which approach best meets these requirements?

  1. A

    Create a SQL scalar UDF that implements the sentiment model directly in SQL expressions and call it in SELECT statements over REVIEW_TEXT.

  2. B

    Create an external function that invokes a remote sentiment analysis service through API integration, and call that function from SQL queries.

  3. C

    Create a stored procedure that returns a sentiment label for each row and use it inline in a SELECT statement against the reviews table.

  4. D

    Export the reviews table to an external stage, run sentiment analysis outside Snowflake, and reload the scored data into a new table each time analysts need updated results.

Show answer and explanation

Correct answer: B

Explanation

The best answer is the external function. In Snowflake, SQL extensibility features include user-defined functions and external functions. When the required business logic depends on a remote service, such as an ML or NLP API for sentiment analysis, an external function is the most appropriate option because it can be called from SQL while delegating execution to an external endpoint through an API integration. This supports direct use in SELECT statements, views, and downstream BI workflows. By contrast, stored procedures are not designed for inline scalar evaluation in queries, and SQL UDFs are limited to logic expressible within SQL. Snowflake documentation on external functions and UDFs emphasizes this distinction: use UDFs for reusable function logic within Snowflake-supported languages or SQL, and external functions when SQL must invoke external services securely.

  • A. Incorrect.

    Incorrect. SQL scalar UDFs are useful SQL extensibility features, but they can only express logic that can be implemented in SQL itself. A real sentiment model typically requires capabilities outside standard SQL expressions. This option sounds attractive because it keeps execution in SQL, but it assumes the model can be natively implemented in SQL, which is usually not realistic for NLP sentiment scoring.

  • B. Correct.

    Correct. External functions are designed to extend SQL by calling remote services from Snowflake through an API integration. This lets analysts invoke sentiment scoring directly in SQL while keeping query workflows inside Snowflake and avoiding manual export/import steps. It is a practical SQL extensibility pattern when the required logic or model is hosted outside Snowflake.

  • C. Incorrect.

    Incorrect. Stored procedures are intended for procedural orchestration, control flow, and administrative or batch operations, not for row-by-row inline invocation inside a SELECT list the way scalar functions are used. This option reflects a common misconception that stored procedures can substitute for functions in query expressions.

  • D. Incorrect.

    Incorrect. Exporting data for external scoring and reloading it increases operational overhead, introduces latency, and breaks the requirement to invoke the logic as part of standard SQL queries. While technically possible, it does not align with the stated goal of minimizing overhead and integrating scoring directly into SQL-based analytics workflows.

Timed practice exam

Take a DAA-C01 practice test under exam conditions

65 questions in 115 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam