Question 6
There are two similarly-structured and sized tables, Table_a and Table_b, in a schema with data populated in both tables. A Data Analyst is running queries as part of a preliminary analysis of the data to check the MAX value of a numeric column named num which is present in both the tables:
* Query 1: SELECT MAX(num) FROM Table_a;
* Query 2: SELECT MAX(num) FROM Table_b;
After running the queries, the Analyst observed that Query 2 ran significantly slower than Query 1. Why is this occurring?
Question 7
A Data Analyst needs to write a query that will return all projects from a project table and all employees from an employee table. What type of join should be used in this query?
Question 8
You are designing a data pipeline that requires executing a sequence of SQL statements conditionally based on the success or failure of previous steps. You want to encapsulate this logic within a stored procedure in Snowflake. Which of the following approaches can be used to achieve this conditional execution within a stored procedure, and what are their key differences regarding error handling and control flow?
Question 9
You are working with a table 'ORDERS' containing order data, and a table 'CUSTOMER SEGMENTS containing customer segment information. The 'ORDERS' table has columns 'ORDER ID', 'CUSTOMER ID, and 'ORDER AMOUNT'. The 'CUSTOMER SEGMENTS' table has columns 'CUSTOMER ID', 'SEGMENT ID', and 'SEGMENT NAME'. You need to create a query that enriches the 'ORDERS' table with the customer segment information. However, a customer can belong to multiple segments. You want to include all segments a customer belongs to in the enriched data, resulting in potentially multiple rows per order if the customer is in multiple segments. The output should include 'ORDER ID, 'ORDER AMOUNT, 'SEGMENT ID', and 'SEGMENT NAMES. Which SQL statement would correctly enrich the ORDERS table without losing any order information, even if customers belong to multiple segments?
Question 10
You're tasked with creating a Snowsight dashboard to monitor the performance of different ETL pipelines. The dashboard needs to display the average run time and the number of errors for each pipeline over the last 7 days. The data is stored in a table called 'ETL LOGS' with columns 'end_time', and 'error_flag' (boolean). You need to present this information in a way that users can easily compare the performance of different pipelines. Which of the following SQL queries, used as the basis for a Snowsight tile, would be MOST appropriate for this dashboard?
