exam questions

Exam SnowPro Core All Questions

View all questions & answers for the SnowPro Core exam

Exam SnowPro Core topic 1 question 549 discussion

Actual exam question from Snowflake's SnowPro Core
Question #: 549
Topic #: 1
[All SnowPro Core Questions]

Which function should be used to find the query ID of the second query executed in a current session?

  • A. Select LAST_QUERY_ID(-2)
  • B. Select LAST_QUERY_ID(-1)
  • C. Select LAST_QUERY_ID(1)
  • D. Select LAST_QUERY_ID(2)
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
BobFar
8 months, 2 weeks ago
Positive numbers start with the first query executed in the session. For example: LAST_QUERY_ID(1) returns the first query. LAST_QUERY_ID(2) returns the second query. LAST_QUERY_ID(6) returns the sixth query. Negative numbers start with the most recently-executed query in the session. For example: LAST_QUERY_ID(-1) returns the most recently-executed query (equivalent to LAST_QUERY_ID()). LAST_QUERY_ID(-2) returns the second most recently-executed query. https://docs.snowflake.com/en/sql-reference/functions/last_query_id#usage-notes
upvoted 2 times
...
BobFar
8 months, 2 weeks ago
Correct Answer is D. LAST_QUERY_ID(2) returns the second query LAST_QUERY_ID(-2) returns the second most recently-executed query
upvoted 1 times
...
MultiCloudIronMan
11 months, 1 week ago
Selected Answer: D
correct
upvoted 1 times
...
bibisa
1 year, 4 months ago
Selected Answer: D
Positive numbers start with the first query executed in the session. For example: LAST_QUERY_ID(1) returns the first query. LAST_QUERY_ID(2) returns the second query. LAST_QUERY_ID(6) returns the sixth query. Etc. Negative numbers start with the most recently-executed query in the session. For example: LAST_QUERY_ID(-1) returns the most recently-executed query (equivalent to LAST_QUERY_ID()). LAST_QUERY_ID(-2) returns the second most recently-executed query. Etc.
upvoted 4 times
...
ShagunMittal
1 year, 4 months ago
Selected Answer: D
LAST_QUERY_ID(2) returns the second query LAST_QUERY_ID(-2) returns the second most recently-executed query
upvoted 4 times
...
Katarzyna04
1 year, 4 months ago
Should be A, tested in Snowflake.
upvoted 1 times
Simbajagnole
1 year, 4 months ago
Incorrect, its D
upvoted 2 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 ...