exam questions

Exam SnowPro Advanced Architect All Questions

View all questions & answers for the SnowPro Advanced Architect exam

Exam SnowPro Advanced Architect topic 1 question 118 discussion

Actual exam question from Snowflake's SnowPro Advanced Architect
Question #: 118
Topic #: 1
[All SnowPro Advanced Architect Questions]

Instead of updating a particular row, a user forgot to put in the where clause and accidentally updated the entire table, named customer.

The variable error_update_query_id is set to query_id for the mistaken update statement.

How can the current version of the table customer be preserved into the table CUSTOMER_ERROR, and the table CUSTOMER be restored to the version that was in place prior to the update?

  • A. CREATE TABLE CUSTOMER_ERROR AS CUSTOMER BEFORE(STATEMENT => $error_update_query_id)
    ALTER TABLE CUSTOMER SWAP WITH CUSTOMER ERROR;
    __________________________________________________________
  • B. CREATE TABLE CUSTOMER_ERROR CLONE CUSTOMER BEFORE(STATEMENT => $error_update_query_id)
    ALTER TABLE CUSTOMER SWAP WITH CUSTOMER_ERROR;
    __________________________________________________________
  • C. CREATE TABLE CUSTOMER_ERROR LIKE CUSTOMER BEFORE(STATEMENT => $error_update_query_id);
    ALTER TABLE CUSTOMER SWAP WITH CUSTOMER ERROR;
    __________________________________________________________
  • D. CREATE TABLE CUSTOMER_ERROR AS SELECT * FROM CUSTOMER BEFORE(STATEMENT =>
    $error_update_query_id);
    __________________________________________________________
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
YCT
3 weeks, 6 days ago
Selected Answer: B
CREATE TABLE CUSTOMER_ERROR CLONE CUSTOMER BEFORE(STATEMENT => $error_update_query_id) ALTER TABLE CUSTOMER SWAP WITH CUSTOMER_ERROR; Actually, this does satisfy the requirement best — here’s why: CLONE CUSTOMER BEFORE(STATEMENT => …) creates a clone of the pre-update version. ALTER TABLE CUSTOMER SWAP WITH CUSTOMER_ERROR; swaps the clone (old version) with the current table (new version). The swap automatically preserves the current version (post-update) inside CUSTOMER_ERROR. So after the swap: CUSTOMER = old (restored) version. CUSTOMER_ERROR = new (erroneous) version.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...