SnowPro Associate: Platform Question 266
Single answer● View the table definitionA data engineer needs to verify the exact column definitions, data types, and nullability for an existing table named SALES in the PROD_DB.PUBLIC schema before updating an ETL mapping. They want a quick SQL-based way to view the table definition metadata directly in Snowflake. Which command should they use?
- A
DESCRIBE TABLE PROD_DB.PUBLIC.SALES;
- B
SHOW TABLES LIKE 'SALES' IN SCHEMA PROD_DB.PUBLIC;
- C
SELECT * FROM PROD_DB.PUBLIC.SALES;
- D
GET_DDL('TABLE', 'PROD_DB.PUBLIC.SALES');
Show answer and explanation
Correct answer: A
Explanation
In Snowflake, DESCRIBE TABLE (or its synonym DESC TABLE) is used to view a table's column-level definition, including names, types, nullability, default values, and similar metadata. This makes it the best fit when an engineer needs to confirm the current schema before changing ETL logic. SHOW commands provide object listings rather than detailed definitions, and SELECT queries return data instead of metadata. Although GET_DDL is valid for retrieving the DDL statement of a table, SnowPro Associate questions commonly distinguish between viewing object metadata directly with DESCRIBE and retrieving object creation SQL with GET_DDL. See Snowflake documentation for DESCRIBE TABLE and GET_DDL for the differences in purpose and output.
- A. Correct.
Correct. DESCRIBE TABLE returns metadata about the table's columns, including column names, data types, nullability, default values, and related definition details. This is the standard SQL command to quickly inspect a table's structure when validating ETL mappings or checking schema details.
- B. Incorrect.
Incorrect. SHOW TABLES lists table objects and high-level metadata such as name, database, schema, kind, and timestamps, but it does not return the detailed column-level definition needed to inspect data types and nullability.
- C. Incorrect.
Incorrect. Querying the table data with SELECT * returns rows from the table, not the table definition. While a user might infer some information from results or client tooling, this is not the correct or reliable way to view schema metadata in Snowflake.
- D. Incorrect.
Incorrect. GET_DDL can return the CREATE TABLE statement for an object and is useful for recreating or comparing DDL. However, for quickly viewing table definition metadata such as columns and nullability directly in a tabular SQL output, DESCRIBE TABLE is the more appropriate and expected command in this scenario.