CERTIFIED-DATA-ANALYST-ASSOCIATE · Question #96
CERTIFIED-DATA-ANALYST-ASSOCIATE Question #96: Real Exam Question with Answer & Explanation
The correct answer is C: CREATE OR REPLACE TABLE database_name.table_name (width INT, length INT,. Option C is correct because CREATE OR REPLACE TABLE atomically drops and recreates the table if it already exists (ensuring it starts empty), and the column schema is defined directly in parentheses immediately after the table name - the standard SQL syntax for schema declaration
Question
A data analyst needs to create an empty managed table table_name in database database_name with a specific schema. The table needs to be recreated and empty, regardless of whether or not the table already exists. Which command can the analyst use to complete the task?
Options
- ACREATE TABLE database_name.table_name USING (width INT, length INT,
- BCREATE OR REPLACE TABLE database_name.table_name USING (width INT,
- CCREATE OR REPLACE TABLE database_name.table_name (width INT, length INT,
- DCREATE OR REPLACE TABLE table_name FROM database_name USING (width INT,
Explanation
Option C is correct because CREATE OR REPLACE TABLE atomically drops and recreates the table if it already exists (ensuring it starts empty), and the column schema is defined directly in parentheses immediately after the table name - the standard SQL syntax for schema declaration.
Option A fails because plain CREATE TABLE throws an error if the table already exists; it lacks the OR REPLACE clause needed to handle the "recreate regardless" requirement.
Option B is wrong because USING specifies a file format (e.g., USING DELTA), not a column schema - you cannot define columns with USING.
Option D uses invalid syntax: FROM database_name has no meaning in a CREATE TABLE statement; the database is specified as part of the two-part identifier database_name.table_name, not in a FROM clause.
Memory tip: Think of it as two independent requirements - "recreate safely" → CREATE OR REPLACE, and "define columns" → (col TYPE, ...) in parentheses. Any option mixing up USING for column definitions or separating the database with FROM is a syntax trap.
Community Discussion
No community discussion yet for this question.