nerdexam
SnowflakeSnowflake

SOL-C01 · Question #154

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

The correct answer is A: Option A. Option A is correct because it creates a table with a default value for 'order_date' using 'DEFAULT CURRENT_DATE and specifies clustering on 'customer_id' using `CLUSTER BY (customer_id)' during table creation. Snowflake supports specifying clustering keys during table creation.

Querying and Performance

Question

You are tasked with creating a table in Snowflake to store customer order data. You need to ensure that the 'order date' column always defaults to the current date if no value is provided during insertion. Additionally, you want to enable automatic clustering on the 'customer id' column to optimize query performance for order retrieval by customer. Which of the following SQL statements correctly date DATE DEFAULT CURRENT DATE) ORDER BY (customer_id); achieves this?

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D
  • EOption E

Explanation

Option A is correct because it creates a table with a default value for 'order_date' using 'DEFAULT CURRENT_DATE and specifies clustering on 'customer_id' using `CLUSTER BY (customer_id)' during table creation. Snowflake supports specifying clustering keys during table creation. Option B is incorrect because 'ORDER BY' clause is used for ordering the data during query, not for clustering. Option C is also correct as the 'CLUSTER BY' can be done using ALTER statement as well . Option D is incorrect because Snowflake does not use traditional indexes and the syntax 'CREATE CLUSTERING INDEX is invalid. option E is incorrect because 'AUTOMATIC CLUSTERING BY' is not a valid syntax.

Topics

#CREATE TABLE#DEFAULT constraint#Automatic Clustering#Clustering Key

Community Discussion

No community discussion yet for this question.

Full SOL-C01 PracticeBrowse All SOL-C01 Questions