<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shahab Nasir on Medium]]></title>
        <description><![CDATA[Stories by Shahab Nasir on Medium]]></description>
        <link>https://medium.com/@shahab.nasir?source=rss-d2239029fc22------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Shahab Nasir on Medium</title>
            <link>https://medium.com/@shahab.nasir?source=rss-d2239029fc22------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:19:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shahab.nasir/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Snowflake SnowPro Core Certification — Questions 21–30 Practice Questions With Solutions.]]></title>
            <link>https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-questions-21-30-practice-questions-with-solutions-44535ff08a08?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/44535ff08a08</guid>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowpro]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowpro-core-exam]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Wed, 08 Nov 2023 18:16:37 GMT</pubDate>
            <atom:updated>2023-11-08T18:16:37.970Z</atom:updated>
            <content:encoded><![CDATA[<h3>Snowflake SnowPro Core Certification — Questions 21–30 Practice Questions With Solutions. Part 3 of 10.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*m9KWAEkPwSv2VlMXjRo8CA.png" /><figcaption>Source: Snowflake</figcaption></figure><p>In this blog post, I will be sharing practice questions 21–30 for the Snowflake SnowPro Core Certification exam. By practicing with these questions, you can refine your understanding of Snowflake’s core concepts and increase your chances of success on the certification exam. Answer Key is at the bottom.</p><p>This is Part 3.</p><p>Questions 1–10 can be found on the blog post for <a href="https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-10-practice-questions-with-solutions-part-1-879576142efe">Part 1</a> .</p><p>Questions 11–20 can be found on the blog post for <a href="https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-questions-11-20-practice-questions-with-solutions-99f262dd2779">Part 2</a>.</p><h3><strong>Question 21</strong></h3><p>What is the typical sequence of data loading steps in Snowflake?</p><p>A) Source → Snowflake Stage → Snowflake Table.</p><p>B) Source → Snowflake Table → Snowflake Stage.</p><p>C) Snowflake Table → Source → Snowflake Stage.</p><h3><strong>Question 22</strong></h3><p>Is it possible to adjust the size of virtual warehouses while its actively running queries?</p><p>A) Yes, virtual warehouses can be resized while actively running.</p><p>B) No, virtual warehouses cannot be resized until its stopped and restarted.</p><p>C) Resizing virtual warehouses depends on the cloud provider’s capabilities.</p><p>D) You can only adjust the size of virtual warehouses during specific maintenance windows.</p><h3><strong>Question 23</strong></h3><p>Which property within Resource Monitors allows you to determine whether you want to manage the credit usage for your entire account or for specific sets of warehouses in Snowflake?</p><p>A) Credit Quota</p><p>B) Monitor Level</p><p>C) Schedule</p><p>D) Notification</p><h3><strong>Question 24</strong></h3><p>Does Snowflake have support for Nested Transactions?</p><p>A) Yes, it supports nested transactions.</p><p>B) No, it does not support nested transactions.</p><p>C) It depends on the Snowflake edition.</p><h3><strong>Question 25</strong></h3><p>Is it possible to change the size of a Snowflake warehouse after you have initially selected its size?</p><p>A) Yes, you can change the size of a Snowflake warehouse after the initial selection.</p><p>B) No, the size of a Snowflake warehouse is fixed and cannot be altered.</p><p>C) Warehouse size changes are possible, but only on a yearly basis.</p><p>D) Warehouse size changes require a complete reset of the Snowflake account.</p><h3><strong>Question 26</strong></h3><p>Are external stages in Snowflake dependent on a cloud storage provider for data storage?</p><p>A) Yes, they require a cloud storage provider.</p><p>B) No, they can use local storage.</p><p>C) It depends on the specific Snowflake configuration.</p><p>D) No, external stages can be mapped to on-prem servers.</p><h3><strong>Question 27</strong></h3><p>Which term is specifically related to the compute layer in Snowflake?</p><p>A) Query optimization</p><p>B) Query planning</p><p>C) Query processing</p><h3><strong>Question 28</strong></h3><p>What factors determine the compute cost in Snowflake?</p><p>A) The query execution time.</p><p>B) The query execution time and the waiting query time.</p><p>C) The warehouse size and for how long it runs.</p><h3><strong>Question 29</strong></h3><p>What programming languages do User-Defined Functions (UDFs) in Snowflake support?</p><p>A) SQL and JavaScript</p><p>B) SQL only</p><p>C) JavaScript only</p><p>D) Java, Scala and Python</p><h3><strong>Question 30</strong></h3><p>A query that previously took over 3 minutes on a different warehouse is executed again on a newly provisioned warehouse. Query results are returned in less than a second. What is the likely reason for this change in performance?</p><p>A) Snowflake used the persisted query results from the metadata cache.</p><p>B) Snowflake used the persisted query results from the query result cache.</p><p>C) Snowflake used the persisted query results from the warehouse cache.</p><p>D) A new Snowflake version has been released in the last two hours, improving the speed of the service.</p><h3>Answer Key</h3><h3><strong>Question 21</strong></h3><p><strong>Solution</strong>: A) Source → Snowflake Stage → Snowflake Table.</p><p><strong>Explanation</strong>: In Snowflake, the common data loading process involves first bringing data from a source system (such as a web application) into a Snowflake Stage, which can be an external stage like Amazon S3. Subsequently, the data is copied into a Snowflake table. This sequence ensures efficient data ingestion and management within Snowflake. The given picture further explains the process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*43slFvpI4DOrR1vB" /></figure><p><a href="https://docs.snowflake.com/en/user-guide/data-load-overview">https://docs.snowflake.com/en/user-guide/data-load-overview</a></p><h3><strong>Question 22</strong></h3><p><strong>Solution</strong>: A) Yes, virtual warehouses can be resized while actively running.</p><p><strong>Explanation</strong>:</p><p>Snowflake supports resizing a warehouse at any time, even while running. If a query is running slowly and you have additional queries of similar size and complexity that you want to run on the same warehouse, you might choose to resize the warehouse while it is running; however, note the following:</p><ul><li>As stated earlier about warehouse size, larger is not necessarily faster; for smaller, basic queries that are already executing quickly, you may not see any significant improvement after resizing.</li><li>Resizing a running warehouse does not impact queries that are already being processed by the warehouse; the additional compute resources, once fully provisioned, are only used for queued and new queries.</li><li>Resizing between a 5XL or 6XL warehouse to a 4XL or smaller warehouse results in a brief period during which the customer is charged for both the new warehouse and the old warehouse while the old warehouse is quiesced.</li></ul><p><a href="https://docs.snowflake.com/en/user-guide/warehouses-considerations">https://docs.snowflake.com/en/user-guide/warehouses-considerations</a></p><h3><strong>Question 23</strong></h3><p><strong>Solution</strong>: B) Monitor Level</p><p><strong>Explanation</strong>:</p><p>This property specifies whether the resource monitor is used to monitor the credit usage for your entire Account (i.e. all warehouses in the account) or a specific set of individual warehouses.</p><p>If this property is not set, the resource monitor doesn’t monitor any credit usage. It simply remains dormant.</p><p><a href="https://docs.snowflake.com/en/user-guide/resource-monitors">https://docs.snowflake.com/en/user-guide/resource-monitors</a></p><h3><strong>Question 24</strong></h3><p>Solution: B) No, it does not support nested transactions.</p><p>Explanation: Snowflake does not support nested transactions.</p><p>A transaction is a sequence of SQL statements that are processed as an atomic unit. All statements in the transaction are either applied (i.e. committed) or undone (i.e. rolled back) together. Snowflake transactions guarantee <a href="http://en.wikipedia.org/wiki/ACID">ACID properties</a>.</p><p>A transaction can include both reads and writes.</p><p>Transactions follow these rules:</p><ul><li>Transactions are never “nested”. For example, you cannot create an “outer” transaction that would roll back an “inner” transaction that was committed, or create an “outer” transaction that would commit an “inner” transaction that had been rolled back.</li><li>A transaction is associated with a single session. Multiple sessions cannot share the same transaction. For information about handling transactions with overlapping threads in the same session, see <a href="https://docs.snowflake.com/en/sql-reference/transactions#label-transactions-and-multi-threading">Transactions and Multi-threading</a>.</li></ul><p><a href="https://docs.snowflake.com/en/sql-reference/transactions">https://docs.snowflake.com/en/sql-reference/transactions</a></p><h3><strong>Question 25</strong></h3><p><strong>Solution</strong>: A) Yes, you can change the size of a Snowflake warehouse after the initial selection.</p><p><strong>Explanation : </strong>Snowflake supports resizing a warehouse at any time.</p><p><a href="https://docs.snowflake.com/en/user-guide/warehouses-considerations">https://docs.snowflake.com/en/user-guide/warehouses-considerations</a></p><h3><strong>Question 26</strong></h3><p><strong>Solution</strong>: A) Yes, they require a cloud storage provider.</p><p><strong>Explanation</strong>:</p><p>External Stages references data files stored in a location outside of Snowflake. Currently, the following cloud storage services are supported:</p><ul><li>Amazon S3 buckets</li><li>Google Cloud Storage buckets</li><li>Microsoft Azure containers</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Wgco6GVSxdYhwIeL" /></figure><p><a href="https://docs.snowflake.com/en/sql-reference/sql/create-stage">https://docs.snowflake.com/en/sql-reference/sql/create-stage</a></p><h3><strong>Question 27</strong></h3><p><strong>Solution</strong>: C) Query processing.</p><p><strong>Explanation</strong>: In Snowflake’s architecture, the term associated with the compute layer is “Query processing.” This layer handles the actual execution of queries, processing the data and producing results as requested by the user’s queries.</p><p><a href="https://docs.snowflake.com/en/user-guide/intro-key-concepts#query-processing">https://docs.snowflake.com/en/user-guide/intro-key-concepts#query-processing</a></p><h3><strong>Question 28</strong></h3><p><strong>Solution</strong>: C) The warehouse size and for how long it runs.</p><p><strong>Explanation</strong>: Snowflake credits are charged based on the number of virtual warehouses you use, how long they run, and their size.</p><p><a href="https://docs.snowflake.com/en/user-guide/cost-understanding-compute">https://docs.snowflake.com/en/user-guide/cost-understanding-compute</a></p><h3><strong>Question 29</strong></h3><p><strong>Solution</strong>: A) SQL and JavaScript &amp; (D) Java, Scala and Python</p><p><strong>Explanation</strong>: User-defined functions (UDFs) in Snowflake support multiple programming languages including: SQL, JavaScript, Java, Scala and Python</p><p><a href="https://docs.snowflake.com/en/developer-guide/udf/udf-overview">https://docs.snowflake.com/en/developer-guide/udf/udf-overview</a></p><h3>Question 30</h3><p><strong>Solution</strong>: B) Snowflake used the persisted query results from the query result cache.</p><p><strong>Explanation</strong>: This improvement in query performance is often attributed to Snowflake utilizing the persisted query results from the query result cache. The results cache stores query results for 24 hours, allowing for quicker retrieval of identical query results as long as the data in the storage layer remains unchanged, without the need to use a warehouse or consume additional credits.</p><p><a href="https://community.snowflake.com/s/article/Caching-in-the-Snowflake-Cloud-Data-Platform#:~:text=Snowflake%20Cache%20Layers&amp;text=Result%20Cache%3A%20Which%20holds%20the,underlying%20data%20has%20not%20changed">https://community.snowflake.com/s/article/Caching-in-the-Snowflake-Cloud-Data-Platform#:~:text=Snowflake%20Cache%20Layers&amp;text=Result%20Cache%3A%20Which%20holds%20the,underlying%20data%20has%20not%20changed</a>.</p><h3>Thanks for Reading!</h3><p><em>If you like my work and want to support me:</em></p><ol><li><em>You can follow me on Medium </em><a href="https://medium.com/@shahab.nasir"><em>here</em></a><em>.</em></li><li><strong><em>Feel free to clap</em></strong><em> if this post is helpful for you! :)</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44535ff08a08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake SnowPro Core Certification — Questions 11–20 Practice Questions With Solutions.]]></title>
            <link>https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-questions-11-20-practice-questions-with-solutions-99f262dd2779?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/99f262dd2779</guid>
            <category><![CDATA[snowpro]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[exam-preparation]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Mon, 06 Nov 2023 19:28:52 GMT</pubDate>
            <atom:updated>2023-11-06T19:28:52.553Z</atom:updated>
            <content:encoded><![CDATA[<h3>Snowflake SnowPro Core Certification — Questions 11–20 Practice Questions With Solutions. Part 2 of 10.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*m9KWAEkPwSv2VlMXjRo8CA.png" /><figcaption>Source: Snowflake</figcaption></figure><p>In this blog post, I will be sharing practice questions 11–20 for the Snowflake SnowPro Core Certification exam. By practicing with these questions, you can refine your understanding of Snowflake’s core concepts and increase your chances of success on the certification exam. Answer Key is at the bottom.</p><p>This is Part 2.</p><p>Questions 1–10 can be found on the blog post for <a href="https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-10-practice-questions-with-solutions-part-1-879576142efe">Part 1</a> .</p><h3><strong>Question 11</strong></h3><p>What is the recommended method for storing JSON data in Snowflake?</p><p><strong>Options</strong>:</p><p>A) Using a column of the JSON data type.</p><p>B) Using a column of the VARCHAR data type.</p><p>C) Using a column of the VARIANT data type.</p><p>D) Using a column of the NULL data type.</p><h3><strong>Question 12</strong></h3><p>Is Fail-Safe period configurable?</p><ol><li>Yes</li><li>No</li></ol><h3><strong>Question 13</strong></h3><p>Can you use the GET command in Snowflake to download files from an external stage?</p><p>A) Yes, the GET command can be used to download files from external stages.</p><p>B) No, Snowflake does not support the GET command for downloading files.</p><p>C) The GET command is used for querying data, not for file downloads.</p><p>D) The DOWNLOAD command should be used instead of GET for file retrieval from external stages.</p><h3><strong>Question 14</strong></h3><p>What are the various types of stages that exist in Snowflake?</p><p><strong>Options</strong>:</p><p>A) User.</p><p>B) Table.</p><p>C) Named internal.</p><p>D) Named external.</p><p>E) Account.</p><h3><strong>Question 15</strong></h3><p>Which command can be employed in SnowSQL to retrieve files from a stage?</p><p>A) GET.</p><p>B) PUT.</p><p>C) UNLOAD.</p><p>D) INSERT INTO.</p><h3><strong>Question 16</strong></h3><p>Which table function in Snowflake enables the transformation of semi-structured data into a relational format?</p><p>A) FLATTEN.</p><p>B) CHECK_JSON.</p><p>C) PARSE_JSON.</p><h3><strong>Question 17</strong></h3><p>What method does Snowflake employ to restrict the retrieval of a minimal number of micro-partitions as part of a query?</p><p>A) Pruning.</p><p>B) Clustering.</p><p>C) Indexing.</p><p>D) Computing.</p><h3><strong>Question 18</strong></h3><p>In which of the following situations is it advisable to utilize Snowpipe for loading data into Snowflake?</p><p>A) We have a small volume of frequent data.</p><p>B) We have a huge volume of data generated as part of a batch schedule.</p><p>C) In both of the previous scenarios.</p><p>D) For running real-time reports on large data sets.</p><h3><strong>Question 19</strong></h3><p>Does Fail-Safe on tables result in additional storage costs ?</p><p>A) Yes</p><p>B) No</p><h3><strong>Question 20</strong></h3><p>Does Snowflake trigger the re-clustering of a table only when it would benefit from the operation?</p><p>A) True</p><p>B) False</p><h3>Answer Key</h3><h3><strong>Question 11</strong></h3><p><strong>Solution</strong>: C) Using a column of the VARIANT data type.</p><p><strong>Explanation</strong>: In Snowflake, it is best practice to store JSON data as the VARIANT data type within the tables. VARIANT columns can accommodate semi-structured data, including JSON, with a maximum size limit of 16MB. This allows for efficient storage and querying of JSON data using JSON notation, enabling the storage of arrays, objects, and other JSON structures within Snowflake.</p><p><a href="https://docs.snowflake.com/en/sql-reference/data-types-semistructured">https://docs.snowflake.com/en/sql-reference/data-types-semistructured</a></p><h3><strong>Question 12</strong></h3><p>Solution: B) No</p><p>Explanation: Fail-safe provides a (non-configurable) 7-day period during which historical data may be recoverable by Snowflake.</p><p><a href="https://docs.snowflake.com/en/user-guide/data-failsafe">https://docs.snowflake.com/en/user-guide/data-failsafe</a></p><h3><strong>Question 13</strong></h3><p>Solution: B) No, Snowflake does not support the GET command for downloading files.</p><p>Explanation:</p><p>Get command downloads data files from one of the following Snowflake stages to a local directory/folder on a client machine:</p><ul><li>Named internal stage.</li><li>Internal stage for a specified table.</li><li>Internal stage for the current user.</li><li>GET does <strong><em>not</em></strong> support downloading files from external stages. To download files from external stages, use the utilities provided by the cloud service.</li></ul><p><a href="https://docs.snowflake.com/en/sql-reference/sql/get">https://docs.snowflake.com/en/sql-reference/sql/get</a></p><h3><strong>Question 14</strong></h3><p><strong>Solution</strong>:</p><p>A) User.</p><p>B) Table.</p><p>C) Named internal.</p><p>D) Named external.</p><p><strong>Explanation</strong>: Snowflake provides different types of stages to handle data loading and retrieval. These include User stages, Table stages (associated with individual tables), Named internal stages (for internal storage), and Named external stages (for external data sources). Each type of stage serves distinct purposes in managing and organizing data within Snowflake. Snowflake supports creating named external stages.</p><p><a href="https://docs.snowflake.com/en/sql-reference/sql/create-stage">https://docs.snowflake.com/en/sql-reference/sql/create-stage</a></p><p><a href="https://docs.snowflake.com/en/user-guide/data-load-local-file-system-create-stage">https://docs.snowflake.com/en/user-guide/data-load-local-file-system-create-stage</a></p><p><a href="https://docs.snowflake.com/en/user-guide/data-load-s3-create-stage">https://docs.snowflake.com/en/user-guide/data-load-s3-create-stage</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PcgkoG4JaJheZagy" /></figure><h3><strong>Question 15</strong></h3><p><strong>Solution</strong>: A) GET.</p><p><strong>Explanation</strong>: The GET command is utilized in SnowSQL to download files from a Snowflake internal stage, such as a user stage, table stage, or named internal stage, to a directory or folder on a client machine. This operation can be performed using SnowSQL, allowing for easy retrieval of data loaded using the COPY INTO command.</p><p><a href="https://docs.snowflake.com/en/sql-reference/sql/get">https://docs.snowflake.com/en/sql-reference/sql/get</a></p><h3><strong>Question 16</strong></h3><p><strong>Solution</strong>: A) FLATTEN.</p><p><strong>Explanation</strong>: The FLATTEN table function in Snowflake is designed for the conversion of semi-structured data into a relational representation. It works with VARIANT, OBJECT, or ARRAY columns and produces a lateral view, facilitating the handling of semi-structured data in a structured, tabular format.</p><p><a href="https://www.snowflake.com/guides/semi-structured-data-101">https://www.snowflake.com/guides/semi-structured-data-101</a></p><h3><strong>Question 17</strong></h3><p><strong>Solution</strong>: A) Pruning.</p><p><strong>Explanation</strong>: Snowflake utilizes query pruning to analyze and access the minimum number of micro-partitions necessary to answer a query efficiently. This technique optimizes query performance by retrieving only the relevant data, significantly reducing query processing time.</p><p><a href="https://docs.snowflake.com/en/user-guide/tables-clustering-micropartitions">https://docs.snowflake.com/en/user-guide/tables-clustering-micropartitions</a></p><h3><strong>Question 18</strong></h3><p><strong>Solution</strong>: A) We have a small volume of frequent data.</p><p><strong>Explanation</strong>: Snowpipe enables loading data from files as soon as they’re available in a stage. This means you can load data from files in micro-batches, making it available to users within minutes, rather than manually executing COPY statements on a schedule to load larger batches.</p><p><a href="https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro">https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro</a></p><h3><strong>Question 19</strong></h3><p>Solution: A) Yes</p><p>Explanation: Fail-safe provides a (non-configurable) 7-day period during which historical data may be recoverable by Snowflake. Storage fees are incurred for maintaining historical data during both the Time Travel and Fail-safe periods.</p><p><a href="https://docs.snowflake.com/en/user-guide/data-cdp-storage-costs">https://docs.snowflake.com/en/user-guide/data-cdp-storage-costs</a></p><h3><strong>Question 20</strong></h3><p>A) True.</p><p><strong>Explanation</strong>: In Snowflake, when performing Data Manipulation Language (DML) operations such as INSERT, UPDATE, DELETE, MERGE, or COPY, the data in a clustered table can become less optimally clustered. To address this, Snowflake provides automatic and periodic re-clustering to maintain optimal data organization. Importantly, Snowflake only initiates re-clustering for a table when it would result in a benefit to the table’s data organization and performance.</p><h3>Thanks for Reading!</h3><p><em>If you like my work and want to support me:</em></p><ol><li><em>You can follow me on Medium </em><a href="https://medium.com/@shahab.nasir"><em>here</em></a><em>.</em></li><li><strong><em>Feel free to clap</em></strong><em> if this post is helpful for you! :)</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99f262dd2779" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake SnowPro Core Certification — 10 Practice Questions With Solutions. Part 1]]></title>
            <link>https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-10-practice-questions-with-solutions-part-1-879576142efe?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/879576142efe</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowpro]]></category>
            <category><![CDATA[exam-preparation]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[certification]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Sun, 05 Nov 2023 15:17:50 GMT</pubDate>
            <atom:updated>2023-11-06T19:30:45.322Z</atom:updated>
            <content:encoded><![CDATA[<h3>Snowflake SnowPro Core Certification — Questions 1–10 Practice Questions With Solutions. Part 1 of 10.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*m9KWAEkPwSv2VlMXjRo8CA.png" /><figcaption>Source: Snowflake</figcaption></figure><p>In this blog post, I will be sharing 10 practice questions for the Snowflake SnowPro Core Certification exam. By practicing with these questions, you can refine your understanding of Snowflake’s core concepts and increase your chances of success on the certification exam. Answer Key is at the bottom.</p><p>This is Part 1.</p><p><a href="https://medium.com/@shahab.nasir/snowflake-snowpro-core-certification-questions-11-20-practice-questions-with-solutions-99f262dd2779">Part 2</a> : Questions 11–20</p><h3><strong>Question 1</strong></h3><p>Among the options listed, which is not a valid Snowflake Warehouse Size?</p><p>A) S</p><p>B) XL</p><p>C) M</p><p>D) XXS</p><h3><strong>Question 2</strong></h3><p>Does the Fail-Safe period for temporary and transient tables equal 0?</p><p>A) True</p><p>B) False</p><h3><strong>Question 3</strong></h3><p>Does the time travel feature in Snowflake preserve data at the expense of running continuous backups?</p><p>A) True</p><p>B) False</p><h3><strong>Question 4</strong></h3><p>How many predecessor tasks can a child task have?</p><p>A) 1</p><p>B) 100</p><p>C) 1000</p><p>D) 5</p><h3><strong>Question 5</strong></h3><p>How frequently does Snowpipe load data into Snowflake?</p><p>A) As soon as data files are available in a stage.</p><p>B) Once every 1 minute.</p><p>C) Once every 5 minutes.</p><p>D) When we manually execute the COPY procedure.</p><h3><strong>Question 6</strong></h3><p>What types of stages are available in Snowflake?</p><p>A) External stages.</p><p>B) Mix stages.</p><p>C) Internal Stages.</p><p>D) Provider Stages.</p><h3><strong>Question 7</strong></h3><p>Will Snowpipe reload a file with the same name if it was modified 15 days after the original load and copied over to the stage?</p><p>A) No. Snowpipe ignores any files that have already been loaded.</p><p>B) Yes it will copy the file causing potential duplicates. This is because Snowpipe keeps history for only 14 days.</p><h3><strong>Question 8</strong></h3><p>Are shared databases exclusively read-only databases?</p><p>A) Yes</p><p>B) No</p><h3><strong>Question 9</strong></h3><p>Can a single storage integration support multiple external stages?</p><p>A) Yes</p><p>B) No</p><h3><strong>Question 10</strong></h3><p>Which of the following scenarios represents scaling out for a Snowflake virtual Warehouse?</p><p>A) Changing the size of a warehouse from L to XL.</p><p>B) Adding a new virtual warehouse of the same size.</p><p>C) Adding more data storage to your Snowflake account.</p><p>D) Adding more EC2 instances for SQS.</p><h3><strong>Solutions</strong></h3><h3><strong>Question 1</strong></h3><p>D) XXS.</p><p>Explanation:</p><p>There is no XXS (Double Extra Small) Warehouse Size. The smallest available Warehouse Size is X-Small (XS). You can view the various sizes in the provided image or refer to Snowflake’s documentation for more details : <a href="https://docs.snowflake.com/en/user-guide/warehouses-overview">https://docs.snowflake.com/en/user-guide/warehouses-overview</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*Ynd-9DUHmqu0LBa8NfIbiA.png" /></figure><h3><strong>Question 2</strong></h3><p>A) True.</p><p>Explanation:</p><p>The Fail-Safe retention period for temporary and transient tables in Snowflake is indeed 0. Unlike regular tables, they do not have a Fail-Safe retention period.<a href="https://docs.snowflake.com/en/user-guide/tables-temp-transient">https://docs.snowflake.com/en/user-guide/tables-temp-transient</a></p><h3><strong>Question 3</strong></h3><p>B) False.</p><p>Explanation:</p><p>The Time Travel feature in Snowflake allows you to access historical data, including data that has been altered or deleted, within a specified time frame. While using Time Travel may result in additional storage costs, this feature is not dependent on continuous backups like traditional databases.</p><p>When any DML operations are performed on a table, Snowflake retains previous versions of the table data for a defined period of time. This enables querying earlier versions of the data using the <a href="https://docs.snowflake.com/en/sql-reference/constructs/at-before">AT | BEFORE</a> clause. <a href="https://docs.snowflake.com/en/user-guide/data-time-travel">https://docs.snowflake.com/en/user-guide/data-time-travel</a></p><h3><strong>Question 4</strong></h3><p>B) 100</p><p>Explanation:</p><p>A single task can have a maximum of 100 predecessor tasks and 100 child tasks. <a href="https://docs.snowflake.com/en/user-guide/tasks-intro">https://docs.snowflake.com/en/user-guide/tasks-intro</a></p><h3><strong>Question 5</strong></h3><p>A) As soon as data files are available in a stage.</p><p>Explanation:</p><p>Snowpipe enables loading data from files as soon as they’re available in a stage. <a href="https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro">https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro</a></p><h3><strong>Question 6</strong></h3><p>A) External stages.</p><p>C) Internal Stages.</p><p>Explanation:</p><p>In Snowflake, there are primarily two types of stages:</p><p>A) External Stages: These stages reference data files that are stored externally, such as in a cloud storage service like AWS S3, Azure Blob Storage, or Google Cloud Storage. C) Internal Stages: These stages store data files internally within Snowflake, making them a part of the Snowflake ecosystem.</p><p><a href="https://docs.snowflake.com/en/sql-reference/sql/create-stage">https://docs.snowflake.com/en/sql-reference/sql/create-stage</a></p><h3><strong>Question 7</strong></h3><p>B) Yes it will copy the file causing potential duplicates. This is because Snowpipe keeps history for only 14 days.</p><p>Explanation:</p><p><strong>For Files modified and staged again within 14 days</strong></p><p>Snowpipe ignores modified files that are staged again. To reload modified data files, it is currently necessary to recreate the pipe object using the CREATE OR REPLACE PIPE syntax.</p><p><strong>For Files modified and staged again after 14 days</strong></p><p>Snowpipe loads the data again, potentially resulting in duplicate records in the target table.</p><p><a href="https://docs.snowflake.com/en/user-guide/data-load-snowpipe-ts#other-issues">https://docs.snowflake.com/en/user-guide/data-load-snowpipe-ts#other-issues</a></p><h3><strong>Question 8</strong></h3><p>A) Yes</p><p>Explanation:</p><p>All database objects shared between accounts are <strong><em>read-only</em></strong> (i.e. the objects cannot be modified or deleted, including adding or modifying table data).</p><p>Sharing accounts cannot modify or delete objects or data within the shared database. The primary purpose of sharing databases is to enable other accounts to query the data without altering it.</p><p><a href="https://docs.snowflake.com/en/user-guide/data-sharing-intro">https://docs.snowflake.com/en/user-guide/data-sharing-intro</a></p><h3><strong>Question 9</strong></h3><p>A) Yes</p><p>Explanation:</p><p>A single storage integration can support multiple external stages. The URL in the stage definition must align with the storage location specified for the STORAGE_ALLOWED_LOCATIONS parameter.</p><p><strong>STORAGE_ALLOWED_LOCATIONS = (‘<em>cloud_specific_url</em>’)</strong></p><p>Explicitly limits external stages that use the integration to reference one or more storage locations (i.e. S3 bucket, GCS bucket, or Azure container). Supports a comma-separated list of URLs for existing buckets and, optionally, paths used to store data files for loading/unloading. Alternatively supports the * wildcard, meaning “allow access to all buckets and/or paths”.</p><p><a href="https://docs.snowflake.com/en/sql-reference/sql/create-storage-integration">https://docs.snowflake.com/en/sql-reference/sql/create-storage-integration</a></p><h3><strong>Question 10</strong></h3><p>B) Adding a new virtual warehouse of the same size.</p><p>Explanation:</p><p>Scaling out in Snowflake involves adding more virtual warehouses of the same size to work in parallel. This approach increases concurrency and allows for more simultaneous processing of queries. In contrast, scaling up involves changing the size of an existing warehouse to provide more compute power, while the option related to requesting more data storage from the cloud provider is unrelated to scaling virtual warehouses.</p><p>Snowflake supports two ways to scale warehouses:</p><ul><li>Scale up by resizing a warehouse.</li><li>Scale out by adding clusters to a multi-cluster warehouse (requires <a href="https://docs.snowflake.com/en/user-guide/intro-editions">Snowflake Enterprise Edition</a> or higher).</li></ul><h3>Thanks for Reading!</h3><p><em>If you like my work and want to support me:</em></p><ol><li><em>You can follow me on Medium </em><a href="https://medium.com/@shahab.nasir"><em>here</em></a><em>.</em></li><li><strong><em>Feel free to clap</em></strong><em> if this post is helpful for you! :)</em></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=879576142efe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types of Tables in Snowflake]]></title>
            <link>https://medium.com/@shahab.nasir/types-of-tables-in-snowflake-fe08a511dae?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe08a511dae</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Sat, 23 Sep 2023 20:27:58 GMT</pubDate>
            <atom:updated>2023-09-23T20:27:58.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d6fhdXqwieyjpQ8z7xZ9yQ.png" /></figure><p>Tables, as database constructs, are designed to organize data into rows and columns logically. In Snowflake, all data resides within these database tables. In addition to the conventional database tables, Snowflake offers distinct table types tailored for data that doesn’t require long-term retention.</p><p>Snowflake provides support for three primary table types:</p><ol><li>Permanent Table</li><li>Transient Table</li><li>Temporary Table</li></ol><h3>Permanent Table</h3><p>Permanent tables represent the standard, traditional database tables. In Snowflake, they serve as the default table type, requiring no extra syntax during creation to establish their permanence.</p><p>Data residing within permanent tables occupies storage space and contributes to the storage fees associated with your Snowflake account. Moreover, permanent tables offer additional functionalities, including Time-Travel and Fail-Safe features, enhancing data availability and recovery capabilities.</p><p>To create a permanent table in Snowflake, use the following SQL query:</p><p>create table employee (id number, name varchar(50));</p><h3>Transient Table</h3><p>In Snowflake, Transient tables share similarities with permanent tables, but they distinguish themselves by lacking a Fail-safe period and offering only a very limited Time-Travel window. They find their ideal use in scenarios where the data within the table is non-critical and can be re-created through external means if necessary.</p><p>Much like permanent tables, Transient Tables contribute to your overall storage costs within your account. However, due to their absence of Fail-safe functionality, there are no associated Fail-safe expenses — meaning, there are no costs related to preserving data for Fail-safe disaster recovery.</p><p>To create a Transient table in Snowflake, simply include the “transient” keyword within the table creation syntax.</p><p>create transient table employee (id number, name varchar(50));</p><h3>Temporary Table</h3><p>Temporary Tables in Snowflake have a lifespan restricted to the session in which they are initiated and are accessible only throughout that particular session. They remain concealed from other users or sessions, and upon the session’s conclusion, all data housed within the table is permanently purged and cannot be recovered.</p><p>Similar to Transient tables, temporary tables lack a Fail-safe retention period and feature an extremely limited Time-Travel duration. They prove most advantageous for non-permanent, transient data that retains relevance solely within the session of their creation.</p><p>It’s important to note that while Temporary tables are automatically discarded at the end of the session, Snowflake recommends a proactive approach of explicitly dropping these tables when they are no longer needed, especially when dealing with sizable temporary datasets. To create a Temporary table in Snowflake, you must specify the “temporary” attribute within the create table syntax.</p><p>create temporary table employee (id number, name varchar(50));</p><h3>Choosing Right Table Type</h3><p>Choosing the right table type in Snowflake depends on the nature of your data and its intended use.</p><p>Permanent tables are ideal for storing critical data meant for long-term use, offering the benefits of Time-Travel and Fail-Safe features for data availability and recovery.</p><p>Transient tables are suitable when data is non-critical and can be recovered externally.</p><p>Temporary tables, on the other hand, are designed for short-term use within a single session and should be employed for non-permanent, transitory data.</p><p>To make an informed choice, consider your data’s permanence, recovery requirements, and the scope of its usage, ensuring optimal data management within Snowflake.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe08a511dae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Data Engineers Support Data Driven Decision Making?]]></title>
            <link>https://medium.com/@shahab.nasir/how-data-engineers-support-data-driven-decision-making-3e08ca28c7e?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e08ca28c7e</guid>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Tue, 19 Sep 2023 16:37:58 GMT</pubDate>
            <atom:updated>2023-09-19T16:37:58.330Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Htx7vzWhvSE6f7cWh4hlqQ.png" /><figcaption>Image by <a href="https://pixabay.com/users/gdj-1086657/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3846597">Gordon Johnson</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3846597">Pixabay</a></figcaption></figure><p>Data-driven decision making refers to the use of data and analytics to inform and guide decision-making processes. It involves collecting, organizing, and analyzing data in order to generate insights that can be used to make informed decisions.</p><p>Data engineers play a crucial role in supporting decision making by building and maintaining the infrastructure and systems that allow organizations to collect, store, and process data. They work closely with data analysts, data scientists and other stakeholders to ensure that data is properly cleaned, transformed, and integrated from various sources, and is made available for analysis and visualization.</p><p>Some specific ways in which data engineers support data driven decision making include:</p><h3>Building and Maintaining Data Pipelines</h3><p>Data engineers design and implement systems for extracting, transforming, and loading data from various sources into a central repository, such as a data warehouse or data lake. This enables data analysts and data scientists to access and analyze data from multiple sources in a consistent and reliable manner.</p><h3>Setting up Data Infrastructure</h3><p>Data engineers also design and implement the data storage systems that enable analysts and data scientists to efficiently query and analyze large datasets. These systems may include data warehouses, data lakes, and other storage solutions that are optimized for fast and efficient querying.</p><h3>Ensuring Data Quality</h3><p>Poor data quality can lead to incorrect or misleading conclusions, which can have serious consequences. Data engineers ensure that data is clean, accurate, and consistent by applying various quality checks and transformations. These tasks may involve using tools and techniques such as data quality assessments, data profiling, and data scrubbing to identify and address issues with data quality.</p><h3>Implementing Data Governance</h3><p>Data governance is a set of policies, procedures, and processes that are put in place to manage and oversee the handling of data within an organization. Data engineers help to enforce data governance policies and practices, such as data security and privacy, to ensure that data is used ethically and responsibly.</p><p>Effective data governance is critical for ensuring that an organization’s data assets are used responsibly and ethically, and for maximizing the value of those assets.</p><h3>Providing Data Access</h3><p>Data engineers work to provide data analysts and data scientists with access to the data they need to support decision making. This includes setting up access controls and permissions, and developing tools and interfaces that enable users to query and visualize data.</p><p>Data accessibility: Data engineers ensure that data is easily accessible to those who need it. This includes designing and implementing APIs and other data access mechanisms, as well as implementing security measures to protect data from unauthorized access.</p><h3>Providing Support and Guidance</h3><p>Data engineers often work closely with analysts and data scientists to understand their data needs and to provide guidance and support in the design and implementation of data pipelines and storage systems. This may include helping them to optimize queries and to troubleshoot any issues that may arise during the analysis process.</p><h3>Data visualization</h3><p>Data engineers may also work with visualization tools and techniques to help stakeholders better understand and analyze data. This can include building dashboards, charts, and other visualizations to support decision making.</p><h3>Conclusion</h3><p>Data engineers play a critical role in supporting decision making by building and maintaining the infrastructure and systems that enable organizations to effectively collect, store, and process large amounts of data for analysis and visualization. These systems and infrastructure are essential for enabling data-driven insights and decision-making, which can have a significant impact on an organization’s performance and competitiveness.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e08ca28c7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why You Should Avoid SELECT * Queries in Snowflake ?]]></title>
            <link>https://medium.com/@shahab.nasir/why-you-should-avoid-select-queries-in-snowflake-a6264f11939f?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6264f11939f</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[columnar-databases]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 00:38:56 GMT</pubDate>
            <atom:updated>2023-09-18T15:32:41.294Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why You Should Avoid SELECT * Queries in Snowflake ?</h3><figure><img alt="Image by Alexandra_Koch from Pixabay" src="https://cdn-images-1.medium.com/max/1024/1*Qpu2i6VYCiPAlFCttYyn-A.jpeg" /><figcaption>Image by <a href="https://pixabay.com/users/alexandra_koch-621802/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=7212079">Alexandra_Koch</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=7212079">Pixabay</a></figcaption></figure><p>Upon data ingestion into Snowflake, the platform undergoes a transformation process, reconfiguring the data into its internal, finely-tuned, and space-efficient columnar format. This optimized data is then securely stored within cloud storage infrastructure.</p><p>Snowflake takes full responsibility for the intricacies of data storage management. This encompasses organizing data, determining file sizes, defining structures, applying compression techniques, managing metadata, collecting statistics, and overseeing various other facets of data storage. Importantly, it’s worth noting that the data objects stored by Snowflake remain hidden from direct customer visibility and accessibility. Instead, customers interact with this data solely through SQL query operations performed within the Snowflake environment.</p><p>The diagram provided below visually represents the distinction between Row Storage, designed primarily for OLTP systems, and Column Storage (shown on the right), which incorporates notable compression enhancements and enables faster I/O operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*6qsy1mm-OLYJCPsOSHwBfw.png" /></figure><p>For example, if the following query were executed on a table with 50 columns, it would retrieve just 8% of the columns from disk storage.</p><pre>select region, state, city, sum(sales)<br>from orders<br>group by region, state, city;</pre><p>A <a href="https://web.stanford.edu/class/cs345d-01/rl/cstore.pdf">study</a> from Stanford University shows that columnar databases are significantly faster at analytic queries than row-oriented ones because they only read the column values needed to satisfy the query.</p><p>In production systems, avoiding this practice is essential as it brings two significant advantages. First, it reduces the volume of data transferred from remote storage into memory. Second, it ensures the efficient utilization of Virtual Warehouse Cache storage. Both of these benefits play a pivotal role in enhancing the overall query performance of the system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6264f11939f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro Partitions and Clustering in Snowflake — Part 2]]></title>
            <link>https://medium.com/@shahab.nasir/micro-partitions-and-clustering-in-snowflake-part-2-c09724da95fe?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/c09724da95fe</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 00:49:47 GMT</pubDate>
            <atom:updated>2023-09-14T00:49:47.884Z</atom:updated>
            <content:encoded><![CDATA[<h3>Micro Partitions and Clustering in Snowflake — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eaSclUuzQoBdOb0l6dZbiw.jpeg" /></figure><p>Clustering is a way of organizing data in Snowflake tables to improve the performance of queries. It works by grouping similar values of one or more columns together physically. This makes it easier for Snowflake to find the data that you need, which can lead to faster query results.</p><p>Clustering is typically beneficial for tables that are larger than 1 TB in size. This is because the performance gain can be significant for large tables. However, for smaller tables, the additional cost of automated re-clustering may outweigh the performance gain.</p><p>For example, let’s say you have a table that contains purchase data. The table has columns for the customer name, order number, and order description. If you cluster the data by customer name, all of the rows for a particular customer will be stored together. This means that when you run a query to find all of the orders for a particular customer, Snowflake only needs to scan one micro-partition. This can significantly improve the performance of the query.</p><h3>Benefits of Clustering</h3><h4><strong>Improved Query Performance</strong></h4><p>When you apply clustering to a table within Snowflake, it re-organizes the data within the table physically, bringing together comparable values. This reorganization directly influences query performance and offers the subsequent advantages:</p><p>1. Decreased Data Scanning: When executing a query involving filters or searches based on the clustered column(s), Snowflake can avoid reading unnecessary micro-partitions that lack pertinent data. It possesses a more efficient way to locate the required data due to the proximity of similar values. Consequently, this minimizes the volume of data that requires scanning, leading to faster query execution.</p><p>2. Enhanced Concurrency: Clustering also elevates concurrency, which pertains to the capability of handling multiple queries concurrently. When queries run in parallel, Snowflake can allocate distinct micro-partitions to each query, permitting independent processing. This parallel approach empowers Snowflake to manage substantial workloads efficiently and scale effectively.</p><h4><strong>Reduced Storage Space</strong></h4><p>Clustering offers not only advantages for query performance but also contributes to optimizing storage utilization. It delivers the subsequent benefits:</p><ol><li>Enhanced Data Compression: Snowflake employs advanced compression methods, particularly focusing on columnar compression, to diminish the volume of storage space essential for data. As data is clustered, comparable values are co-located physically, which heightens the efficiency of compression algorithms. This enables Snowflake to achieve greater compression ratios within each micro-partition, ultimately resulting in decreased storage requirements and cost savings.</li><li>Streamlined Storage Efficiency: Through the arrangement of similar values in close proximity, clustering prevents the redundancy or duplication of data storage. Instead of storing identical values multiple times, Snowflake retains them within a micro-partition only once. This streamlined storage efficiency further contributes to a reduction in overall storage expenses.</li></ol><h3><strong>Conclusion</strong></h3><p>Micro-partitions and clustering stand as vital features within Snowflake, profoundly impacting performance and scalability. Micro-partitions, acting as the foundational units of data storage, bring forth a multitude of advantages including enhanced query performance, automatic data optimization, and improved concurrency and scalability. On the other hand, clustering orchestrates data arrangement within micro-partitions based on one or more columns, resulting in reduced data scanning, expedited data retrieval, heightened storage efficiency, and cost-effective practices.</p><p>Harnessing the capabilities of micro-partitions and clustering in Snowflake, while taking relevant considerations into account, empowers you to fine-tune query performance, optimize storage efficiency, and enhance overall data management. Ultimately, this translates into superior insights and data-driven decision-making while ensuring cost-effectiveness.</p><p>Read about Micro Partitions in my previous blog post <a href="https://scratchtoskills.com/what-are-snowflake-micro-partitions/">here</a>:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c09724da95fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Micro Partitions and Clustering in Snowflake — Part 1]]></title>
            <link>https://medium.com/@shahab.nasir/what-are-snowflake-micro-partitions-db3b06228df2?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/db3b06228df2</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-storage]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 03:02:03 GMT</pubDate>
            <atom:updated>2023-09-14T00:44:02.029Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0a7cnM_0y6MrHQHqQdFGQ.jpeg" /><figcaption>Photo by panumas nikhomkhai: <a href="https://www.pexels.com/photo/close-up-photo-of-mining-rig-1148820/">https://www.pexels.com/photo/close-up-photo-of-mining-rig-1148820/</a></figcaption></figure><p>Traditional data warehousing solutions often rely on rigid partitioning techniques to enhance performance and enable scalability. In such systems, partitions act as independent units, managed through specialized DDL and syntax. However, static partitioning comes with its well-known limitations, including maintenance complexities and the potential for data skew, resulting in unevenly sized partitions.</p><p>In stark contrast to conventional data warehousing approaches, the Snowflake Data Platform introduces a dynamic and innovative partitioning strategy known as micro-partitioning. This groundbreaking approach inherits all the benefits of static partitioning while gracefully sidestepping its documented drawbacks. Moreover, micro-partitioning brings an array of valuable supplementary advantages.</p><p>Micro-partitioning is an automatic process applied to all Snowflake tables, offering numerous benefits, including compact sizes (ranging from 50 to 500 MB), efficient DML operations, precise pruning for accelerated queries, and mitigation of data skew¹.</p><p>These micro-partitions represent cohesive storage units, each containing a row of data within the same micro-partition. Snowflake empowers users to explicitly select the columns on which a table should be clustered, termed clustering keys. This capability enables Snowflake to maintain clustering based on the chosen columns and provides the flexibility to recluster as needed. Reclustering a table influences its physical organization by rearranging data within specific micro-partitions.</p><h3>Benefits of Micro-Partitions</h3><p>Micro-partitions offer a range of advantages, enhancing query performance, automating data optimization, and improving both concurrency and scalability. Let’s delve into each of these benefits in more detail:</p><h3>Enhanced Query Performance</h3><p>In the Snowflake ecosystem, micro-partitions play a pivotal role in elevating query performance. When you initiate a query in Snowflake, the platform scrutinizes the query and identifies which micro-partitions contain pertinent data based on the query filters. Snowflake’s query optimizer is designed to skip unnecessary micro-partitions, significantly reducing the volume of data that must be scanned during query execution. This optimization technique, known as micro-partition pruning, leads to expedited query performance by minimizing data processing.</p><p>Think of it as searching for a specific item in an impeccably organized room. If the room is divided into multiple sections, and you know the item you’re seeking is solely in one specific section, you can directly access that section without wasting time scouring the entire space. Similarly, by segmenting data into micro-partitions, Snowflake swiftly identifies and retrieves only the pertinent data for a given query, resulting in swift responses.</p><h3>Automatic Data Optimization</h3><p>Snowflake seamlessly applies data compression and optimization techniques to micro-partitions. When data is ingested into Snowflake, it’s stored in a hybrid-columnar format, enabling efficient compression at the column level. This hybrid-columnar storage allows Snowflake to horizontally partition the data into micro-partitions. Each micro-partition, in essence, holds mini-pages of data according to the PAX scheme, alongside offsets and other metadata.</p><p>Visualize it as organizing differently colored blocks. Instead of individually storing each block, you group same-colored blocks, stack them, and compress them to economize on space. When you need to access a specific color, you can swiftly spot the compressed stack and retrieve the requisite blocks. Snowflake’s employment of this compression technique minimizes storage expenses while preserving query performance.</p><h3>Concurrency and Scalability</h3><p>Micro-partitions empower Snowflake to adeptly manage concurrent queries and expand horizontally to accommodate growing demands. Snowflake can simultaneously handle multiple queries by processing them on separate micro-partitions in parallel. This parallelism permits Snowflake to distribute query workloads across distinct computing resources, resulting in expedited query execution and resource usage optimization.</p><p>Imagine several individuals concurrently searching for various items within different sections of a meticulously organized room. By dividing the tasks among multiple people, you can accomplish them more swiftly and efficiently. Similarly, Snowflake’s capacity to work on diverse micro-partitions concurrently enables it to tackle extensive workloads and horizontally scale to meet mounting requirements.</p><h3>Conclusion</h3><p>In summary, micro-partitions usher in a revolutionary era in data warehousing, offering numerous advantages over traditional static partitioning methods. They are automatically applied to all Snowflake tables, boasting features such as compact size, efficient data manipulation, precise query optimization, and the mitigation of data skew.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db3b06228df2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Travel with Snowflake]]></title>
            <link>https://medium.com/@shahab.nasir/time-travel-with-snowflake-cd499ae3918e?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd499ae3918e</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Tue, 12 Sep 2023 02:01:50 GMT</pubDate>
            <atom:updated>2023-09-12T02:01:50.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*o5_z8htHyurl_xnhMCtkfQ.jpeg" /></figure><p>Snowflake Time Travel is a fascinating feature that grants you the power to access historical data. Imagine you have an Employee table, and you accidentally delete it. With Time Travel, you can effortlessly journey back in time, let’s say 5 minutes, and rescue your data. The versatility of Snowflake Time Travel goes beyond just data retrieval; it’s an invaluable tool for a variety of essential tasks:</p><ol><li><strong>Retrieve Altered or Deleted Data:</strong> Easily query data that has been modified or removed in the past, ensuring you never lose critical information.</li><li><strong>Create Historical Clones:</strong> Make exact replicas of entire Tables, Schemas, or even Databases at or before specific dates, perfect for historical analysis or data comparisons.</li><li><strong>Restore Deleted Tables, Schemas, and Databases:</strong> In case of accidental deletion, Time Travel lets you bring back lost Tables, Schemas, and Databases, ensuring you have a safety net for your data.</li></ol><p>Snowflake Time Travel isn’t just about accessing the historical data; it’s a versatile tool that empowers you to manage your data’s history, perform insightful analysis, and safeguard against unexpected data mishaps.</p><h3>Data Retention Period</h3><p>A crucial aspect of Snowflake Time Travel is the <strong>data retention</strong> period, which plays a pivotal role in preserving your data history.</p><p>When data within a table undergoes changes, whether through modifications, deletions, or object removals, Snowflake ensures the preservation of the data’s state prior to these updates. The data retention period is the duration during which this historical data is safeguarded, allowing for Time Travel operations such as SELECT, CREATE, CLONE, and UNDROP to be performed on the data.</p><p>The default retention period stands at 1 day (equivalent to 24 hours), and it is automatically active for all Snowflake accounts. Here’s how it works for different editions:</p><ul><li><strong>Snowflake Standard Edition:</strong> Users have the flexibility to set the retention period to 0 (or revert it to the default 1 day) at both the account and object levels, including databases, schemas, and tables.</li><li><strong>Snowflake Enterprise Edition (and higher):</strong></li><li>For transient databases, schemas, and tables, the retention period can be configured to 0 (or reverted to 1 day).</li><li>The same holds true for temporary tables.</li><li>In the case of permanent databases, schemas, and tables, the retention period can be set to any value ranging from 0 up to a maximum of 90 days.</li></ul><p>When the retention period concludes for an object, the historical data is moved into Snowflake Fail-safe, resulting in the following implications:</p><ul><li>Historical data becomes inaccessible for querying.</li><li>Past objects can no longer be cloned.</li><li>Objects that were previously dropped cannot be restored.</li></ul><h3>Enabling Snowflake Time Travel:</h3><p>Enabling Snowflake Time Travel is a breeze, as it comes turned on by default with a one-day retention period. However, if you wish to extend your Data Retention Periods beyond this default setting, allowing you to preserve data for up to 90 days within Databases, Schemas, and Tables, you’ll need to upgrade to Snowflake Enterprise Edition. It’s worth noting that lengthier Data Retention entails increased storage requirements, which will be reflected in your monthly Storage Fees. For more detailed insights into storage costs associated with Time Travel and Fail-safe, consult Snowflake documentation on <a href="https://docs.snowflake.com/en/user-guide/data-cdp-storage-costs">Storage Costs for Time Travel and Fail-safe</a>.</p><p>As an example, let’s take a look at configuring a table with a generous 90-day retention period for Snowflake Time Travel.</p><pre>create table my_table (col1 number, col2 date) data_retention_time_in_days=90;</pre><p>To reduce the retention period to 30 days for a specific table, you can utilize the following query :</p><pre>alter table my_table set data_retention_time_in_days=30;</pre><h3>Disable Snowflake Time Travel</h3><p>For a Snowflake account, it’s important to note that the Time Travel feature cannot be completely deactivated. However, you have the option to disable Time Travel for specific Databases, Schemas, and Tables by setting the object’s <strong>DATA_RETENTION_TIME_IN_DAYS</strong> to 0.</p><p>Users holding the <strong>ACCOUNTADMIN</strong> role also have the authority to set the <strong>DATA_RETENTION_TIME_IN_DAYS</strong> to 0 at the account level. This implies that, by default, all Databases (and consequently, all Schemas and Tables within those databases) created in the account will have no retention period. Nonetheless, it’s worth highlighting that this default setting can be overridden at any point in time for any Database, Schema, or Table as needed.</p><pre>alter table my_table set data_retention_time_in_days=0;</pre><h3>Conclusion</h3><p>Snowflake Time Travel is a powerful feature that enables users to examine data usage and manipulations over a specific time. The syntax to query with time travel is similar to that of SQL Server, which is easy to understand and execute. <a href="https://docs.snowflake.com/en/user-guide/data-time-travel">With Snowflake Time Travel, users can restore deleted objects, make duplicates, make a Snowflake backup, and recover historical data</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd499ae3918e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Views in Snowflake: Types and Use Cases]]></title>
            <link>https://medium.com/@shahab.nasir/understanding-views-in-snowflake-types-and-use-cases-48f34a363e1b?source=rss-d2239029fc22------2</link>
            <guid isPermaLink="false">https://medium.com/p/48f34a363e1b</guid>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Shahab Nasir]]></dc:creator>
            <pubDate>Sun, 10 Sep 2023 02:20:00 GMT</pubDate>
            <atom:updated>2023-09-10T02:20:00.221Z</atom:updated>
            <content:encoded><![CDATA[<h3>In this article, we will delve into the concept of views in Snowflake, exploring their types and how they are employed within the platform.</h3><figure><img alt="An astronaut lounging in space and running SQL queries on Snowflake." src="https://cdn-images-1.medium.com/max/1024/1*n-eYsjLwvJ5yKLpCHMH20A.png" /></figure><h3>What is a View?</h3><p>A view in Snowflake is essentially a saved SQL query that is given a name and stored in your database. Think of it as a virtual table that can be utilized in almost any context where a regular table can be used, including joins, subqueries, and more. When you query a view, Snowflake dynamically executes the underlying SQL query associated with the view and displays the results.</p><p>To create a view in Snowflake, you can employ the CREATE VIEW command using the following syntax:</p><p>This command allows you to define a view named my_view that retrieves all data from the table my_table. Views provide a powerful way to encapsulate complex SQL logic and simplify data retrieval and analysis.</p><pre>CREATE OR REPLACE VIEW my_view AS SELECT * FROM my_table;</pre><h3>Types of Views in Snowflake</h3><p>Snowflake offers three primary categories of views, each serving distinct purposes:</p><ol><li><strong>Non-Materialized Views (Regular Views):</strong> These views are virtual representations of data, and they do not store the actual data. They are suitable for simplifying complex queries or providing a specific perspective on your data.</li><li><strong>Materialized Views:</strong> Materialized views, on the other hand, do store data physically. They are precomputed and updated periodically, making them ideal for accelerating query performance, especially with large datasets.</li><li><strong>Secure Views:</strong> Secure views provide a security layer for your data by controlling access and masking sensitive information. They help ensure data privacy and compliance with security regulations.</li></ol><h3>Non-Materialized Views in Snowflake</h3><p>Non-Materialized views, often simply referred to as “views,” are a type of view in Snowflake where the results are generated by executing the associated query when the view is referenced in another query. In this section, we’ll delve into the characteristics and usage of Non-Materialized views.</p><h3>Understanding Non-Materialized Views</h3><ol><li><strong>On-Demand Execution:</strong> Non-Materialized views operate on an on-demand basis. This means that when you query a Non-Materialized view, Snowflake dynamically executes the underlying query, fetching the data in real-time. This ensures that you always get the most up-to-date information.</li><li><strong>No Data Storage:</strong> One defining feature of Non-Materialized views is that they do not store the query results for future use. Instead, they act as a virtual representation of your data, simplifying complex queries or providing a specific perspective on your database.</li><li><strong>Performance Considerations:</strong> While Non-Materialized views offer real-time data access, their performance can be slower compared to Materialized views, especially when dealing with large datasets or complex queries. This is because they require the query to be executed each time they are referenced.</li></ol><h3>Creating Non-Materialized Views</h3><p>Creating a Non-Materialized view follows the same syntax as creating a regular view. Here’s an example of a Non-Materialized view created on top of a PATIENT table, selecting only the necessary fields for a doctor:</p><pre>CREATE OR REPLACE VIEW patient_view <br>AS SELECT patient_id, patient_name, diagnosis, treatment FROM PATIENT;</pre><p>In this case, the patient_view simplifies data access for doctors by presenting a subset of fields from the PATIENT table, making it easier to work with patient data.</p><p>Non-Materialized views provide a flexible and dynamic way to interact with your data, ensuring that you always access the most current information without the need for manual updates or data maintenance.</p><h3>Materialized Views in Snowflake</h3><p>Materialized views are a powerful database object in Snowflake that store pre-computed results based on a query definition. Unlike regular views, which dynamically execute queries on-demand, materialized views store a copy of the query results for efficient and rapid access. In this section, we’ll explore the characteristics and use cases of materialized views.</p><h3>Understanding Materialized Views</h3><ol><li><strong>Query Results Storage:</strong> The primary distinction of materialized views lies in their ability to store query results. This pre-computed data is especially useful when you need frequent access to information that doesn’t change frequently. Materialized views serve as a snapshot of the data at a specific point in time.</li><li><strong>Usage Scenario:</strong> Materialized views are best suited for scenarios where data is accessed frequently, and the underlying data in the tables doesn’t undergo frequent updates. In contrast, regular views are typically used when data is accessed infrequently and subject to frequent changes.</li><li><strong>Automatic Maintenance:</strong> Snowflake transparently handles the maintenance of materialized views. This means that as the underlying data changes, Snowflake automatically updates the materialized view to reflect those changes. However, it’s important to note that this automatic maintenance consumes Snowflake credits.</li><li><strong>Limitations:</strong> Materialized views come with certain limitations. They can query only a single table and do not support joins, including self-joins. For a comprehensive list of limitations, you can refer to the Snowflake Documentation.</li></ol><h3>Creating Materialized Views</h3><p>To create a materialized view, you use the MATERIALIZED keyword in the standard Data Definition Language (DDL) syntax for views. Here’s an example of a materialized view created based on the PATIENT table, selecting specific fields required for the finance team:</p><pre>CREATE OR REPLACE MATERIALIZED VIEW finance_view <br>AS SELECT patient_id, patient_name, billing_address, cost FROM PATIENT;</pre><p>In this example, the finance_view stores a snapshot of patient data relevant to the finance team, ensuring quick and efficient access to the required information.</p><p>Materialized views provide a valuable tool for optimizing query performance and data access when dealing with large datasets or frequent queries. In the next section, we’ll explore Secure Views and their role in data security and access control within Snowflake.</p><h3>Secure Views in Snowflake</h3><p>Secure views in Snowflake are a critical component for enhancing data security and access control. They restrict access to the data definition of the view, ensuring that sensitive information remains hidden from unauthorized users. In this section, we’ll explore the key characteristics and benefits of secure views.</p><h3>Understanding Secure Views</h3><ol><li><strong>Data Privacy:</strong> Secure views are designed to safeguard sensitive data by limiting access to specific users or roles. This ensures that only authorized individuals can view sensitive information, protecting it from exposure to unauthorized users.</li><li><strong>Versatility:</strong> Both non-materialized and materialized views can be defined as secure, providing flexibility in securing your data. This versatility allows you to apply security measures to various types of views based on your specific requirements.</li><li><strong>Advantages:</strong> Secure views offer several advantages over standard views, including improved data privacy and controlled data sharing. They enable organizations to implement fine-grained access control, ensuring that sensitive data is accessible only to those with the appropriate permissions.</li><li><strong>Access Control:</strong> The definition of a secure view is exposed only to authorized users who have been granted the role that owns the view. This strict access control mechanism ensures that sensitive data remains protected and confidential.</li></ol><h3>Creating Secure Views</h3><p>To create a secure view, you can use the SECURE keyword in conjunction with the standard Data Definition Language (DDL) syntax for views. Here’s an example of a secure view created based on the PATIENT table:</p><pre>CREATE OR REPLACE SECURE VIEW patient_view AS SELECT * FROM PATIENT;</pre><p>In this case, the patient_view restricts access to the PATIENT data, ensuring that only authorized users or roles can access the view’s data definition.</p><p>While secure views provide robust security measures, it’s important to be aware that they can have some performance impacts, particularly when handling complex security configurations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48f34a363e1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>