nerdexam
SnowflakeSnowflake

SOL-C01 · Question #308

SOL-C01 Question #308: Real Exam Question with Answer & Explanation

The correct answer is B: Create a Snowflake View that pre-aggregates the total order amount per customer. Query this. Option B is the most effective solution. Creating a Snowflake View pre-aggregates the data, reducing the amount of data transferred and processed. Using 'st.cache_data' then ensures that Streamlit caches the results of the query, preventing unnecessary database calls on subsequen

Querying and Performance

Question

You are developing a Streamlit application that visualizes data from a Snowflake table called `CUSTOMER ORDERS. The application needs to display the total order amount for each customer, but the dataset is large. Which of the following Snowflake features, combined with Streamlit's caching capabilities, would be the MOST effective to optimize query performance and reduce costs?

Options

  • AUse 'ORDER BY clause in the SQL query to sort the results before sending them to Streamlit.
  • BCreate a Snowflake View that pre-aggregates the total order amount per customer. Query this
  • CCreate a Snowflake external table linked to CSV files containing customer order data and query
  • DUse a Snowflake User-Defined Function (IJDF) written in Python to calculate the total order
  • EImport the entire table into a Pandas DataFrame within the Streamlit app and perform the

Explanation

Option B is the most effective solution. Creating a Snowflake View pre-aggregates the data, reducing the amount of data transferred and processed. Using 'st.cache_data' then ensures that Streamlit caches the results of the query, preventing unnecessary database calls on subsequent runs. Ordering data (A) doesnt improve performance, external table is not related here (C) , UDF in streamit is expensive and defeats the purpose (D) and loading entire table is not scaleable (E) .

Topics

#Query Optimization#Snowflake Views#Data Aggregation#Cost Optimization

Community Discussion

No community discussion yet for this question.

Full SOL-C01 PracticeBrowse All SOL-C01 Questions