
Answer-first summary for fast verification
Answer: SELECT EVENT_TIMESTAMP, USER_NAME FROM ACCOUNT_USAGE.LOGIN_HISTORY;
The question requires retrieving login history for the last 90 days. Option D (ACCOUNT_USAGE.LOGIN_HISTORY) is correct because it stores login data for up to 365 days, allowing retrieval of the full 90-day history. Option B (information_schema.login_history_by_user()) is incorrect as it only returns data from the last 7 days, which is insufficient for the 90-day requirement. Option A (ACCOUNT_USAGE.USERS) is incorrect as it contains user metadata but not login timestamps. Option C (ACCOUNT_USAGE.ACCESS_HISTORY) is incorrect as it tracks query and object access history, not login events. The community discussion strongly supports D with 94% consensus and upvoted comments confirming that B is limited to 7 days, while D provides the necessary 90-day coverage.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Which of the following statements will return a report of all Snowflake logins, including the date and user, from the last 90 days?
A
SELECT LAST_SUCCESS_LOGIN, LOGIN_NAME FROM ACCOUNT_USAGE.USERS;
B
SELECT EVENT_TIMESTAMP, USER_NAME FROM table(information_schema.login_history_by_user())
C
SELECT EVENT_TIMESTAMP, USER_NAME FROM ACCOUNT_USAGE.ACCESS_HISTORY;
D
SELECT EVENT_TIMESTAMP, USER_NAME FROM ACCOUNT_USAGE.LOGIN_HISTORY;
No comments yet.