QuestionQ331

Data Store Management

A data engineer must create a new empty table in Amazon Athena with the same schema as an existing table named old_table.

Which SQL statement should the data engineer use to satisfy this requirement?

  • A CREATE TABLE new_table AS SELECT * FROM old_tables;
  • B INSERT INTO new_table SELECT * FROM old_table;
  • C CREATE TABLE new_table (LIKE old_table);
  • D CREATE TABLE new_table AS (SELECT * FROM old_table) WITH NO DATA;
Explanation

In Amazon Athena, CREATE TABLE AS SELECT ... WITH NO DATA creates an empty table using the schema produced by the SELECT statement. Selecting all columns from old_table therefore creates new_table with the same schema while copying no rows.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!