ExamGecko
Question list
Search
Search

List of questions

Search

Related questions

Question 102 - ARA-C01 discussion

Report
Export

A table, EMP_ TBL has three records as shown:

The following variables are set for the session:

Which SELECT statements will retrieve all three records? (Select TWO).

A.
Select * FROM Stbl_ref WHERE Scol_ref IN ('Name1','Nam2','Name3');
Answers
A.
Select * FROM Stbl_ref WHERE Scol_ref IN ('Name1','Nam2','Name3');
B.
SELECT * FROM EMP_TBL WHERE identifier(Scol_ref) IN ('Namel','Name2', 'Name3');
Answers
B.
SELECT * FROM EMP_TBL WHERE identifier(Scol_ref) IN ('Namel','Name2', 'Name3');
C.
SELECT * FROM identifier<Stbl_ref> WHERE NAME IN ($var1, $var2, $var3);
Answers
C.
SELECT * FROM identifier<Stbl_ref> WHERE NAME IN ($var1, $var2, $var3);
D.
SELECT * FROM identifier($tbl_ref) WHERE ID IN Cvarl','var2','var3');
Answers
D.
SELECT * FROM identifier($tbl_ref) WHERE ID IN Cvarl','var2','var3');
E.
SELECT * FROM $tb1_ref WHERE $col_ref IN ($var1, Svar2, Svar3);
Answers
E.
SELECT * FROM $tb1_ref WHERE $col_ref IN ($var1, Svar2, Svar3);
Suggested answer: B, E

Explanation:

The correct answer is B and E because they use the correct syntax and values for the identifier function and the session variables.

The identifier function allows you to use a variable or expression as an identifier (such as a table name or column name) in a SQL statement. It takes a single argument and returns it as an identifier. For example, identifier($tbl_ref) returns EMP_TBL as an identifier.

The session variables are set using the SET command and can be referenced using the $ sign. For example, $var1 returns Name1 as a value.

Option A is incorrect because it uses Stbl_ref and Scol_ref, which are not valid session variables or identifiers. They should be $tbl_ref and $col_ref instead.

Option C is incorrect because it uses identifier<Stbl_ref>, which is not a valid syntax for the identifier function. It should be identifier($tbl_ref) instead.

Option D is incorrect because it uses Cvarl, var2, and var3, which are not valid session variables or values. They should be $var1, $var2, and $var3 instead.Reference:

Snowflake Documentation: Identifier Function

Snowflake Documentation: Session Variables

Snowflake Learning: SnowPro Advanced: Architect Exam Study Guide

asked 23/09/2024
Peter Shillingford
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first